Imports
System.DrawingPublic
Class form1Inherits System.Windows.Forms.Form
#
Region " Windows Form Designer generated code " Public Sub New() MyBase.New() 'This call is required by the Windows Form Designer.InitializeComponent()
'Add any initialization after the InitializeComponent() call End Sub 'Form overrides dispose to clean up the component list. Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) If disposing Then If Not (components Is Nothing) Thencomponents.Dispose()
End If End If MyBase.Dispose(disposing) End Sub 'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor.<System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent() ' 'mypen ' Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13) Me.ClientSize = New System.Drawing.Size(292, 266) Me.Name = "mypen" Me.Text = "Form1" End Sub#
End Region Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs) Dim g As Graphics = e.Graphics Dim stripe As Image = New Bitmap("e:\colorbars.jpg") Dim b1 As TextureBrush = New TextureBrush(stripe) Dim b2 As SolidBrush = New SolidBrush(Color.Aquamarine) Dim p1 As Penp1 =
New Pen(b1, 10)g.DrawLine(p1, 20, 20,
Me.Width - 40, Me.Height - 40)System.Threading.Thread.CurrentThread.Sleep(1000)
p1 =
New Pen(b2, 10)g.DrawLine(p1, 20, 20,
Me.Width - 40, Me.Height - 40)System.Threading.Thread.CurrentThread.Sleep(1000)
p1 =
New Pen(Color.BlanchedAlmond, 10)g.DrawLine(p1, 20, 20,
Me.Width - 40, Me.Height - 40)System.Threading.Thread.CurrentThread.Sleep(1000)
b1.Dispose()
b2.Dispose()
p1.Dispose()
End SubEnd
Class
invalid parameter
shoagMSFT
Mostafa Omar
No accessible 'Main' method with an appropriate signature was found in 'MyPen.main_sub'.
This is what I`m getting.
Mareen Philip MSFT
Amit Paka
If not your start-up where is the form being called from
LMcFarlin
What version 03 or 05
Chris Duxbury
Is it a string....needs quotes
Where is it defined
Dim b1 As TextureBrush = New TextureBrush(stripe)
Witi
I am real new to vb and just feeling my way through, so it is probably something simple.
Any help will be greatly appreciated.
bodalal
from the solution explorer...right click on your project and go to properties...
change the start-up object from sub main to your form...
invalid display name
zz1
It was thrown at the {Public Class form1} line.
bear007
at which line is this exception thrown that makes it lots easier to find you bug.
Aleborg
on the debugger toolbar keep stepping into...or use 'F11'
untill you get to your error....
Hannodb
djchapin