473,387 Members | 1,569 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How do I fix this code?? any ideas?

RON
Can anyone tell me how I would fix this code to do the following?

I want the buttons to be 0 through 9 not 1 through 10 like they are now.
==
Inherits System.Windows.Forms.Form

Public buttons(9) As Button

Const ButtonWH As Integer = 30 'Width & height of buttons

Private Sub Button_click(ByVal sender As System.Object, _

ByVal e As System.EventArgs)

Dim n As Integer

Dim s As String

s = CType(sender, System.Windows.Forms.Button).Text

If IsNumeric(s) Then

n = Convert.ToInt32(s)

lblOutput.Text = lblOutput.Text & (n)

Else

lblOutput.Text = "Incorrect use of handler!"

End If

End Sub

Private Sub createButtons(ByVal i As Integer, ByVal pnt As Point) 'Which &
where

'Populate form with Buttons

buttons(i) = New Button

buttons(i).Enabled = True

buttons(i).Visible = True

buttons(i).Text = Convert.ToString(i + 1) '1, 2, 3, ...

buttons(i).Size = New System.Drawing.Size(ButtonWH, ButtonWH)

buttons(i).Location = pnt

Me.Controls.Add(buttons(i))

End Sub



#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) Then

components.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.

Friend WithEvents btnExit As System.Windows.Forms.Button

Friend WithEvents lblOutput As System.Windows.Forms.Label

Friend WithEvents Button1 As System.Windows.Forms.Button

<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

Me.btnExit = New System.Windows.Forms.Button

Me.lblOutput = New System.Windows.Forms.Label

Me.Button1 = New System.Windows.Forms.Button

Me.SuspendLayout()

'

'btnExit

'

Me.btnExit.Location = New System.Drawing.Point(200, 248)

Me.btnExit.Name = "btnExit"

Me.btnExit.Size = New System.Drawing.Size(64, 24)

Me.btnExit.TabIndex = 0

Me.btnExit.Text = "Exit"

'

'lblOutput

'

Me.lblOutput.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.25!,
System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0,
Byte))

Me.lblOutput.Location = New System.Drawing.Point(112, 104)

Me.lblOutput.Name = "lblOutput"

Me.lblOutput.Size = New System.Drawing.Size(256, 48)

Me.lblOutput.TabIndex = 1

Me.lblOutput.TextAlign = System.Drawing.ContentAlignment.MiddleCenter

'

'Button1

'

Me.Button1.Location = New System.Drawing.Point(176, 160)

Me.Button1.Name = "Button1"

Me.Button1.Size = New System.Drawing.Size(104, 24)

Me.Button1.TabIndex = 2

Me.Button1.Text = "Clear Label"

'

'Form1

'

Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)

Me.ClientSize = New System.Drawing.Size(536, 273)

Me.Controls.Add(Me.Button1)

Me.Controls.Add(Me.lblOutput)

Me.Controls.Add(Me.btnExit)

Me.Name = "Form1"

Me.Text = "Form1"

Me.ResumeLayout(False)

End Sub

#End Region

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnExit.Click

Me.Close()

End Sub

Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

lblOutput.Text = ""

End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Dim i, j, row As Integer

'Dim start As Char = "A"c

'Dim alpha(9) As Char

Dim pntCurrent As Point

row = 24

For i = 0 To 9

If i Mod 2 = 0 Then

j = i + 1

Else

j = i - 1

End If

Next

j = 0

For i = 0 To 9

j = i Mod 13 + 2

If i = 13 Then

row = 65 ' Drop to next line

End If

pntCurrent = New Point(j * (ButtonWH + 8), row)

Call createButtons(i, pntCurrent)

'create Buttons populates the form with the Buttons

Next

For k As Integer = 0 To buttons.GetUpperBound(0)

AddHandler buttons(k).Click, AddressOf Button_click

Next

End Sub
Apr 2 '06 #1
4 1258
You already seem to be naming them 1 - 10, have I misunderstood you ?
buttons(i).Text = Convert.ToString(i + 1) '1, 2, 3, ...
--
( OHM ) - One Handed Man
AKA Terry Burns - http://TrainingOn.net


"RON" <ro*@none.invalid> wrote in message
news:Oh**************@TK2MSFTNGP10.phx.gbl... Can anyone tell me how I would fix this code to do the following?

I want the buttons to be 0 through 9 not 1 through 10 like they are now.
==
Inherits System.Windows.Forms.Form

Public buttons(9) As Button

Const ButtonWH As Integer = 30 'Width & height of buttons

Private Sub Button_click(ByVal sender As System.Object, _

ByVal e As System.EventArgs)

Dim n As Integer

Dim s As String

s = CType(sender, System.Windows.Forms.Button).Text

If IsNumeric(s) Then

n = Convert.ToInt32(s)

lblOutput.Text = lblOutput.Text & (n)

Else

lblOutput.Text = "Incorrect use of handler!"

End If

End Sub

Private Sub createButtons(ByVal i As Integer, ByVal pnt As Point) 'Which &
where

'Populate form with Buttons

buttons(i) = New Button

buttons(i).Enabled = True

buttons(i).Visible = True

buttons(i).Text = Convert.ToString(i + 1) '1, 2, 3, ...

buttons(i).Size = New System.Drawing.Size(ButtonWH, ButtonWH)

buttons(i).Location = pnt

Me.Controls.Add(buttons(i))

End Sub



#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) Then

components.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.

Friend WithEvents btnExit As System.Windows.Forms.Button

Friend WithEvents lblOutput As System.Windows.Forms.Label

Friend WithEvents Button1 As System.Windows.Forms.Button

<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()

Me.btnExit = New System.Windows.Forms.Button

Me.lblOutput = New System.Windows.Forms.Label

Me.Button1 = New System.Windows.Forms.Button

Me.SuspendLayout()

'

'btnExit

'

Me.btnExit.Location = New System.Drawing.Point(200, 248)

Me.btnExit.Name = "btnExit"

Me.btnExit.Size = New System.Drawing.Size(64, 24)

Me.btnExit.TabIndex = 0

Me.btnExit.Text = "Exit"

'

'lblOutput

'

Me.lblOutput.Font = New System.Drawing.Font("Microsoft Sans Serif",
11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point,
CType(0, Byte))

Me.lblOutput.Location = New System.Drawing.Point(112, 104)

Me.lblOutput.Name = "lblOutput"

Me.lblOutput.Size = New System.Drawing.Size(256, 48)

Me.lblOutput.TabIndex = 1

Me.lblOutput.TextAlign = System.Drawing.ContentAlignment.MiddleCenter

'

'Button1

'

Me.Button1.Location = New System.Drawing.Point(176, 160)

Me.Button1.Name = "Button1"

Me.Button1.Size = New System.Drawing.Size(104, 24)

Me.Button1.TabIndex = 2

Me.Button1.Text = "Clear Label"

'

'Form1

'

Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)

Me.ClientSize = New System.Drawing.Size(536, 273)

Me.Controls.Add(Me.Button1)

Me.Controls.Add(Me.lblOutput)

Me.Controls.Add(Me.btnExit)

Me.Name = "Form1"

Me.Text = "Form1"

Me.ResumeLayout(False)

End Sub

#End Region

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnExit.Click

Me.Close()

End Sub

Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

lblOutput.Text = ""

End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Dim i, j, row As Integer

'Dim start As Char = "A"c

'Dim alpha(9) As Char

Dim pntCurrent As Point

row = 24

For i = 0 To 9

If i Mod 2 = 0 Then

j = i + 1

Else

j = i - 1

End If

Next

j = 0

For i = 0 To 9

j = i Mod 13 + 2

If i = 13 Then

row = 65 ' Drop to next line

End If

pntCurrent = New Point(j * (ButtonWH + 8), row)

Call createButtons(i, pntCurrent)

'create Buttons populates the form with the Buttons

Next

For k As Integer = 0 To buttons.GetUpperBound(0)

AddHandler buttons(k).Click, AddressOf Button_click

Next

End Sub

Apr 2 '06 #2
RON
right
the buttons on the form are:
1,2,3,4,5,6,7,8,9,10
I would like them to be:
0,1,2,3,4,5,6,7,8,9

So I would like them to start at zero

"OHM ( One Handed Man )" <me@mine.com> wrote in message
news:eU**************@TK2MSFTNGP09.phx.gbl...
You already seem to be naming them 1 - 10, have I misunderstood you ?
buttons(i).Text = Convert.ToString(i + 1) '1, 2, 3, ...


--
( OHM ) - One Handed Man
AKA Terry Burns - http://TrainingOn.net


"RON" <ro*@none.invalid> wrote in message
news:Oh**************@TK2MSFTNGP10.phx.gbl...
Can anyone tell me how I would fix this code to do the following?

I want the buttons to be 0 through 9 not 1 through 10 like they are now.
==
Inherits System.Windows.Forms.Form

Public buttons(9) As Button

Const ButtonWH As Integer = 30 'Width & height of buttons

Private Sub Button_click(ByVal sender As System.Object, _

ByVal e As System.EventArgs)

Dim n As Integer

Dim s As String

s = CType(sender, System.Windows.Forms.Button).Text

If IsNumeric(s) Then

n = Convert.ToInt32(s)

lblOutput.Text = lblOutput.Text & (n)

Else

lblOutput.Text = "Incorrect use of handler!"

End If

End Sub

Private Sub createButtons(ByVal i As Integer, ByVal pnt As Point) 'Which
& where

'Populate form with Buttons

buttons(i) = New Button

buttons(i).Enabled = True

buttons(i).Visible = True

buttons(i).Text = Convert.ToString(i + 1) '1, 2, 3, ...

buttons(i).Size = New System.Drawing.Size(ButtonWH, ButtonWH)

buttons(i).Location = pnt

Me.Controls.Add(buttons(i))

End Sub



#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) Then

components.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.

Friend WithEvents btnExit As System.Windows.Forms.Button

Friend WithEvents lblOutput As System.Windows.Forms.Label

Friend WithEvents Button1 As System.Windows.Forms.Button

<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()

Me.btnExit = New System.Windows.Forms.Button

Me.lblOutput = New System.Windows.Forms.Label

Me.Button1 = New System.Windows.Forms.Button

Me.SuspendLayout()

'

'btnExit

'

Me.btnExit.Location = New System.Drawing.Point(200, 248)

Me.btnExit.Name = "btnExit"

Me.btnExit.Size = New System.Drawing.Size(64, 24)

Me.btnExit.TabIndex = 0

Me.btnExit.Text = "Exit"

'

'lblOutput

'

Me.lblOutput.Font = New System.Drawing.Font("Microsoft Sans Serif",
11.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point,
CType(0, Byte))

Me.lblOutput.Location = New System.Drawing.Point(112, 104)

Me.lblOutput.Name = "lblOutput"

Me.lblOutput.Size = New System.Drawing.Size(256, 48)

Me.lblOutput.TabIndex = 1

Me.lblOutput.TextAlign = System.Drawing.ContentAlignment.MiddleCenter

'

'Button1

'

Me.Button1.Location = New System.Drawing.Point(176, 160)

Me.Button1.Name = "Button1"

Me.Button1.Size = New System.Drawing.Size(104, 24)

Me.Button1.TabIndex = 2

Me.Button1.Text = "Clear Label"

'

'Form1

'

Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)

Me.ClientSize = New System.Drawing.Size(536, 273)

Me.Controls.Add(Me.Button1)

Me.Controls.Add(Me.lblOutput)

Me.Controls.Add(Me.btnExit)

Me.Name = "Form1"

Me.Text = "Form1"

Me.ResumeLayout(False)

End Sub

#End Region

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnExit.Click

Me.Close()

End Sub

Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

lblOutput.Text = ""

End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Dim i, j, row As Integer

'Dim start As Char = "A"c

'Dim alpha(9) As Char

Dim pntCurrent As Point

row = 24

For i = 0 To 9

If i Mod 2 = 0 Then

j = i + 1

Else

j = i - 1

End If

Next

j = 0

For i = 0 To 9

j = i Mod 13 + 2

If i = 13 Then

row = 65 ' Drop to next line

End If

pntCurrent = New Point(j * (ButtonWH + 8), row)

Call createButtons(i, pntCurrent)

'create Buttons populates the form with the Buttons

Next

For k As Integer = 0 To buttons.GetUpperBound(0)

AddHandler buttons(k).Click, AddressOf Button_click

Next

End Sub


Apr 2 '06 #3
Don't add 1?

buttons(i).Text = Convert.ToString(i) '1, 2, 3, ...
' instead of
buttons(i).Text = Convert.ToString(i + 1) '1, 2, 3, ...

"RON" <ro*@none.invalid> wrote in message
news:u9**************@TK2MSFTNGP09.phx.gbl...
right
the buttons on the form are:
1,2,3,4,5,6,7,8,9,10
I would like them to be:
0,1,2,3,4,5,6,7,8,9

So I would like them to start at zero

"OHM ( One Handed Man )" <me@mine.com> wrote in message
news:eU**************@TK2MSFTNGP09.phx.gbl...
You already seem to be naming them 1 - 10, have I misunderstood you ?
buttons(i).Text = Convert.ToString(i + 1) '1, 2, 3, ...


--
( OHM ) - One Handed Man
AKA Terry Burns - http://TrainingOn.net


"RON" <ro*@none.invalid> wrote in message
news:Oh**************@TK2MSFTNGP10.phx.gbl...
Can anyone tell me how I would fix this code to do the following?

I want the buttons to be 0 through 9 not 1 through 10 like they are now.
==
Inherits System.Windows.Forms.Form

Public buttons(9) As Button

Const ButtonWH As Integer = 30 'Width & height of buttons

Private Sub Button_click(ByVal sender As System.Object, _

ByVal e As System.EventArgs)

Dim n As Integer

Dim s As String

s = CType(sender, System.Windows.Forms.Button).Text

If IsNumeric(s) Then

n = Convert.ToInt32(s)

lblOutput.Text = lblOutput.Text & (n)

Else

lblOutput.Text = "Incorrect use of handler!"

End If

End Sub

Private Sub createButtons(ByVal i As Integer, ByVal pnt As Point) 'Which
& where

'Populate form with Buttons

buttons(i) = New Button

buttons(i).Enabled = True

buttons(i).Visible = True

buttons(i).Text = Convert.ToString(i + 1) '1, 2, 3, ...

buttons(i).Size = New System.Drawing.Size(ButtonWH, ButtonWH)

buttons(i).Location = pnt

Me.Controls.Add(buttons(i))

End Sub



#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) Then

components.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.

Friend WithEvents btnExit As System.Windows.Forms.Button

Friend WithEvents lblOutput As System.Windows.Forms.Label

Friend WithEvents Button1 As System.Windows.Forms.Button

<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()

Me.btnExit = New System.Windows.Forms.Button

Me.lblOutput = New System.Windows.Forms.Label

Me.Button1 = New System.Windows.Forms.Button

Me.SuspendLayout()

'

'btnExit

'

Me.btnExit.Location = New System.Drawing.Point(200, 248)

Me.btnExit.Name = "btnExit"

Me.btnExit.Size = New System.Drawing.Size(64, 24)

Me.btnExit.TabIndex = 0

Me.btnExit.Text = "Exit"

'

'lblOutput

'

Me.lblOutput.Font = New System.Drawing.Font("Microsoft Sans Serif",
11.25!, System.Drawing.FontStyle.Bold,
System.Drawing.GraphicsUnit.Point, CType(0, Byte))

Me.lblOutput.Location = New System.Drawing.Point(112, 104)

Me.lblOutput.Name = "lblOutput"

Me.lblOutput.Size = New System.Drawing.Size(256, 48)

Me.lblOutput.TabIndex = 1

Me.lblOutput.TextAlign = System.Drawing.ContentAlignment.MiddleCenter

'

'Button1

'

Me.Button1.Location = New System.Drawing.Point(176, 160)

Me.Button1.Name = "Button1"

Me.Button1.Size = New System.Drawing.Size(104, 24)

Me.Button1.TabIndex = 2

Me.Button1.Text = "Clear Label"

'

'Form1

'

Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)

Me.ClientSize = New System.Drawing.Size(536, 273)

Me.Controls.Add(Me.Button1)

Me.Controls.Add(Me.lblOutput)

Me.Controls.Add(Me.btnExit)

Me.Name = "Form1"

Me.Text = "Form1"

Me.ResumeLayout(False)

End Sub

#End Region

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnExit.Click

Me.Close()

End Sub

Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

lblOutput.Text = ""

End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Dim i, j, row As Integer

'Dim start As Char = "A"c

'Dim alpha(9) As Char

Dim pntCurrent As Point

row = 24

For i = 0 To 9

If i Mod 2 = 0 Then

j = i + 1

Else

j = i - 1

End If

Next

j = 0

For i = 0 To 9

j = i Mod 13 + 2

If i = 13 Then

row = 65 ' Drop to next line

End If

pntCurrent = New Point(j * (ButtonWH + 8), row)

Call createButtons(i, pntCurrent)

'create Buttons populates the form with the Buttons

Next

For k As Integer = 0 To buttons.GetUpperBound(0)

AddHandler buttons(k).Click, AddressOf Button_click

Next

End Sub



Apr 2 '06 #4
RON
ah yes!! Thank you!

"Jim Hughes" <NO*********@Hotmail.com> wrote in message
news:ec**************@TK2MSFTNGP12.phx.gbl...
Don't add 1?

buttons(i).Text = Convert.ToString(i) '1, 2, 3, ...
' instead of
buttons(i).Text = Convert.ToString(i + 1) '1, 2, 3, ...

"RON" <ro*@none.invalid> wrote in message
news:u9**************@TK2MSFTNGP09.phx.gbl...
right
the buttons on the form are:
1,2,3,4,5,6,7,8,9,10
I would like them to be:
0,1,2,3,4,5,6,7,8,9

So I would like them to start at zero

"OHM ( One Handed Man )" <me@mine.com> wrote in message
news:eU**************@TK2MSFTNGP09.phx.gbl...
You already seem to be naming them 1 - 10, have I misunderstood you ?

buttons(i).Text = Convert.ToString(i + 1) '1, 2, 3, ...

--
( OHM ) - One Handed Man
AKA Terry Burns - http://TrainingOn.net


"RON" <ro*@none.invalid> wrote in message
news:Oh**************@TK2MSFTNGP10.phx.gbl...
Can anyone tell me how I would fix this code to do the following?

I want the buttons to be 0 through 9 not 1 through 10 like they are
now.
==
Inherits System.Windows.Forms.Form

Public buttons(9) As Button

Const ButtonWH As Integer = 30 'Width & height of buttons

Private Sub Button_click(ByVal sender As System.Object, _

ByVal e As System.EventArgs)

Dim n As Integer

Dim s As String

s = CType(sender, System.Windows.Forms.Button).Text

If IsNumeric(s) Then

n = Convert.ToInt32(s)

lblOutput.Text = lblOutput.Text & (n)

Else

lblOutput.Text = "Incorrect use of handler!"

End If

End Sub

Private Sub createButtons(ByVal i As Integer, ByVal pnt As Point)
'Which & where

'Populate form with Buttons

buttons(i) = New Button

buttons(i).Enabled = True

buttons(i).Visible = True

buttons(i).Text = Convert.ToString(i + 1) '1, 2, 3, ...

buttons(i).Size = New System.Drawing.Size(ButtonWH, ButtonWH)

buttons(i).Location = pnt

Me.Controls.Add(buttons(i))

End Sub



#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) Then

components.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.

Friend WithEvents btnExit As System.Windows.Forms.Button

Friend WithEvents lblOutput As System.Windows.Forms.Label

Friend WithEvents Button1 As System.Windows.Forms.Button

<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()

Me.btnExit = New System.Windows.Forms.Button

Me.lblOutput = New System.Windows.Forms.Label

Me.Button1 = New System.Windows.Forms.Button

Me.SuspendLayout()

'

'btnExit

'

Me.btnExit.Location = New System.Drawing.Point(200, 248)

Me.btnExit.Name = "btnExit"

Me.btnExit.Size = New System.Drawing.Size(64, 24)

Me.btnExit.TabIndex = 0

Me.btnExit.Text = "Exit"

'

'lblOutput

'

Me.lblOutput.Font = New System.Drawing.Font("Microsoft Sans Serif",
11.25!, System.Drawing.FontStyle.Bold,
System.Drawing.GraphicsUnit.Point, CType(0, Byte))

Me.lblOutput.Location = New System.Drawing.Point(112, 104)

Me.lblOutput.Name = "lblOutput"

Me.lblOutput.Size = New System.Drawing.Size(256, 48)

Me.lblOutput.TabIndex = 1

Me.lblOutput.TextAlign = System.Drawing.ContentAlignment.MiddleCenter

'

'Button1

'

Me.Button1.Location = New System.Drawing.Point(176, 160)

Me.Button1.Name = "Button1"

Me.Button1.Size = New System.Drawing.Size(104, 24)

Me.Button1.TabIndex = 2

Me.Button1.Text = "Clear Label"

'

'Form1

'

Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)

Me.ClientSize = New System.Drawing.Size(536, 273)

Me.Controls.Add(Me.Button1)

Me.Controls.Add(Me.lblOutput)

Me.Controls.Add(Me.btnExit)

Me.Name = "Form1"

Me.Text = "Form1"

Me.ResumeLayout(False)

End Sub

#End Region

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnExit.Click

Me.Close()

End Sub

Private Sub Button1_Click_1(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

lblOutput.Text = ""

End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Dim i, j, row As Integer

'Dim start As Char = "A"c

'Dim alpha(9) As Char

Dim pntCurrent As Point

row = 24

For i = 0 To 9

If i Mod 2 = 0 Then

j = i + 1

Else

j = i - 1

End If

Next

j = 0

For i = 0 To 9

j = i Mod 13 + 2

If i = 13 Then

row = 65 ' Drop to next line

End If

pntCurrent = New Point(j * (ButtonWH + 8), row)

Call createButtons(i, pntCurrent)

'create Buttons populates the form with the Buttons

Next

For k As Integer = 0 To buttons.GetUpperBound(0)

AddHandler buttons(k).Click, AddressOf Button_click

Next

End Sub



Apr 2 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

53
by: Cardman | last post by:
Greetings, I am trying to solve a problem that has been inflicting my self created Order Forms for a long time, where the problem is that as I cannot reproduce this error myself, then it is...
4
by: Sammy | last post by:
Hello all Is there a good online resource that discusses C++ equivalents for windows code? Not a simple subject of course... but perhaps a good place to start with the simpler parts. Thx :o)
8
by: Paul Cochrane | last post by:
Hi all, I've got an application that I'm writing that autogenerates python code which I then execute with exec(). I know that this is not the best way to run things, and I'm not 100% sure as to...
41
by: Seth | last post by:
I am in need of source code for the Aho Corasick algorithm. I have tried searching the web but can't seem to find any code. Is there a good site for c code I can search? Thanks in advance.
3
by: Frankie | last post by:
I have an ASP.NET Web application that has dozens of aspx pages, associated code-behind classes, class modules, etc. I'm wondering how I can quickly count the number of lines of code I've...
9
by: WRH | last post by:
Hello I am new to asp but I made some Jscript functions which work fine. The functions contain some strings used as a registration key for some apps. It is important that these strings not be...
32
by: Jon Paal | last post by:
trying to use this script for scrolling tables found at this link: http://www.litotes.demon.co.uk/example_scripts/tableScroll.html The top left corner in the table grid is hidden from being...
64
by: Bayazee | last post by:
hi can we hide a python code ? if i want to write a commercial software can i hide my source code from users access ? we can conver it to pyc but this file can decompiled ... so ...!! do you...
16
by: Rex | last post by:
Hi All - I have a question that I think MIGHT be of interest to a number of us developers. I am somewhat new to VIsual Studio 2005 but not new to VB. I am looking for ideas about quick and...
66
by: Jon Skeet [C# MVP] | last post by:
I'm sure the net will be buzzing with this news fairly soon, but just in case anyone hasn't seen it yet: Microsoft are going to make the source code for the .NET framework (parts of it,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.