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 4 1257
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
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
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
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
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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)
|
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...
|
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.
|
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...
|
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...
|
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...
|
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...
|
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...
|
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,...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |