473,545 Members | 1,956 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Shortcuts on Buttons vb.net - desperately seeking help

Hi everyone,

i was wondering if anyone else had observed this and if there is any
workaround or patch.

i have some screens (an mdi child forms) with the buttons &Add, &Edit,
&Save and E&xit, the idea being that the user can use Alt+A, Alt+E etc
etc

when any screen loads, Add, Edit and Exit are enabled.

if the user selects Add or Edit then the Add/Edit/Exit buttons
disabled, and the Save button is enabled.

users can keep more than one form open at a time.

what i find is that if the user has more than one child screen open,
only one of the buttons eg Alt + A on the top screen (i.e the child
with focus) works and the Alt + S does not.

what is happening here?

this is annoying because i would like the users to use the keyboard as
much as possible, not the mouse.

please help.

below is some cut and paste code for an mdi form and 2 child forms (2
* form1) with identical buttons that reproduces the issue.

form2 is the mdi parent, form1 is the child

the buttons work fine if only one form is open, but die if there are
more than one open.

regards

Edwinah63

*************md i parent **************

Public Class Form2
Inherits System.Windows. Forms.Form

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeCompo nent()

'Add any initialization after the InitializeCompo nent() 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.Disp ose()
End If
End If
MyBase.Dispose( disposing)
End Sub

'Required by the Windows Form Designer
Private components As System.Componen tModel.IContain er

'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 Panel1 As System.Windows. Forms.Panel
Friend WithEvents Button1 As System.Windows. Forms.Button
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()
Me.Panel1 = New System.Windows. Forms.Panel
Me.Button1 = New System.Windows. Forms.Button
Me.Panel1.Suspe ndLayout()
Me.SuspendLayou t()
'
'Panel1
'
Me.Panel1.Contr ols.Add(Me.Butt on1)
Me.Panel1.Locat ion = New System.Drawing. Point(5, 382)
Me.Panel1.Name = "Panel1"
Me.Panel1.Size = New System.Drawing. Size(148, 37)
Me.Panel1.TabIn dex = 1
'
'Button1
'
Me.Button1.Loca tion = New System.Drawing. Point(21, 7)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing. Size(105, 22)
Me.Button1.TabI ndex = 0
Me.Button1.Text = "Button1"
'
'Form2
'
Me.AutoScaleBas eSize = New System.Drawing. Size(5, 13)
Me.ClientSize = New System.Drawing. Size(439, 451)
Me.Controls.Add (Me.Panel1)
Me.IsMdiContain er = True
Me.Name = "Form2"
Me.Text = "Form2"
Me.Panel1.Resum eLayout(False)
Me.ResumeLayout (False)

End Sub

#End Region

Private Sub Form2_Load(ByVa l sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Dim f1 As New Form1
f1.MdiParent = Me
f1.Show()

Dim f2 As New Form1
f2.MdiParent = Me
f2.Show()

End Sub
End Class
****** now for the child form
Public Class Form1
Inherits System.Windows. Forms.Form

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeCompo nent()

'Add any initialization after the InitializeCompo nent() 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.Disp ose()
End If
End If
MyBase.Dispose( disposing)
End Sub

'Required by the Windows Form Designer
Private components As System.Componen tModel.IContain er

'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 TextBox1 As System.Windows. Forms.TextBox
Friend WithEvents btnAdd As System.Windows. Forms.Button
Friend WithEvents btnEdit As System.Windows. Forms.Button
Friend WithEvents btnSave As System.Windows. Forms.Button
Friend WithEvents btnReset As System.Windows. Forms.Button
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()
Me.btnAdd = New System.Windows. Forms.Button
Me.btnEdit = New System.Windows. Forms.Button
Me.btnSave = New System.Windows. Forms.Button
Me.btnReset = New System.Windows. Forms.Button
Me.TextBox1 = New System.Windows. Forms.TextBox
Me.SuspendLayou t()
'
'btnAdd
'
Me.btnAdd.Locat ion = New System.Drawing. Point(17, 39)
Me.btnAdd.Name = "btnAdd"
Me.btnAdd.Size = New System.Drawing. Size(83, 23)
Me.btnAdd.TabIn dex = 0
Me.btnAdd.Text = "&Add"
'
'btnEdit
'
Me.btnEdit.Loca tion = New System.Drawing. Point(17, 73)
Me.btnEdit.Name = "btnEdit"
Me.btnEdit.Size = New System.Drawing. Size(80, 22)
Me.btnEdit.TabI ndex = 1
Me.btnEdit.Text = "&Edit"
'
'btnSave
'
Me.btnSave.Loca tion = New System.Drawing. Point(18, 114)
Me.btnSave.Name = "btnSave"
Me.btnSave.Size = New System.Drawing. Size(78, 21)
Me.btnSave.TabI ndex = 2
Me.btnSave.Text = "&Save"
'
'btnReset
'
Me.btnReset.Loc ation = New System.Drawing. Point(18, 150)
Me.btnReset.Nam e = "btnReset"
Me.btnReset.Siz e = New System.Drawing. Size(80, 22)
Me.btnReset.Tab Index = 3
Me.btnReset.Tex t = "Rese&t"
'
'TextBox1
'
Me.TextBox1.Loc ation = New System.Drawing. Point(142, 93)
Me.TextBox1.Nam e = "TextBox1"
Me.TextBox1.Siz e = New System.Drawing. Size(138, 20)
Me.TextBox1.Tab Index = 4
Me.TextBox1.Tex t = ""
'
'Form1
'
Me.AutoScaleBas eSize = New System.Drawing. Size(5, 13)
Me.ClientSize = New System.Drawing. Size(292, 273)
Me.Controls.Add (Me.TextBox1)
Me.Controls.Add (Me.btnReset)
Me.Controls.Add (Me.btnSave)
Me.Controls.Add (Me.btnEdit)
Me.Controls.Add (Me.btnAdd)
Me.Name = "Form1"
Me.Text = "Hotkeys!!"
Me.ResumeLayout (False)

End Sub

#End Region
Private Sub btnAdd_Click(By Val sender As System.Object, ByVal e As
System.EventArg s) Handles btnAdd.Click
Me.TextBox1.Tex t = "Add"
Config("A")
End Sub

Private Sub btnEdit_Click(B yVal sender As Object, ByVal e As
System.EventArg s) Handles btnEdit.Click
Me.TextBox1.Tex t = "Edit"
Config("E")
End Sub
Private Sub btnSave_Click(B yVal sender As Object, ByVal e As
System.EventArg s) Handles btnSave.Click
Me.TextBox1.Tex t = "Save"
Config("R")
End Sub
Private Sub btnReset_Click( ByVal sender As System.Object, ByVal e
As System.EventArg s) Handles btnReset.Click
'clear
Me.TextBox1.Tex t = ""
Config("R")
End Sub

Private Sub Config(ByVal x As String)

Select Case x
Case "A", "E"
btnAdd.Enabled = False
btnEdit.Enabled = False
btnSave.Enabled = True

Case "R"
btnAdd.Enabled = True
btnEdit.Enabled = True
btnSave.Enabled = False

End Select
End Sub

Private Sub Form1_Load(ByVa l sender As Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Config("R")
End Sub
End Class
Nov 21 '05 #1
5 1526
..net Framework Service Pack 1 Fixes this issue.
Without the Service Pack you need to change the Buttons Text When it
Activates/Deactivates so that only one button has the shortcut at any one
time.

\\\
Private Sub Form1_Activated (ByVal sender As Object, ByVal e As EventArgs) _
Handles MyBase.Activate d
btnAdd.Text = "&Add"
btnEdit.Text = "&Edit"
btnSave.Text = "&Save"
btnReset.Text = "Rese&t"
End Sub

Private Sub Form1_Deactivat e(ByVal sender As Object, ByVal e As EventArgs) _
Handles MyBase.Deactiva te
btnAdd.Text = "Add"
btnEdit.Text = "Edit"
btnSave.Text = "Save"
btnReset.Text = "Reset"
End Sub
///

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Edwinah63" <ed*****@custom ercare.com.au> wrote in message
news:d7******** *************** ***@posting.goo gle.com...
Hi everyone,

i was wondering if anyone else had observed this and if there is any
workaround or patch.

i have some screens (an mdi child forms) with the buttons &Add, &Edit,
&Save and E&xit, the idea being that the user can use Alt+A, Alt+E etc
etc

when any screen loads, Add, Edit and Exit are enabled.

if the user selects Add or Edit then the Add/Edit/Exit buttons
disabled, and the Save button is enabled.

users can keep more than one form open at a time.

what i find is that if the user has more than one child screen open,
only one of the buttons eg Alt + A on the top screen (i.e the child
with focus) works and the Alt + S does not.

what is happening here?

this is annoying because i would like the users to use the keyboard as
much as possible, not the mouse.

please help.

below is some cut and paste code for an mdi form and 2 child forms (2
* form1) with identical buttons that reproduces the issue.

form2 is the mdi parent, form1 is the child

the buttons work fine if only one form is open, but die if there are
more than one open.

regards

Edwinah63

*************md i parent **************

Public Class Form2
Inherits System.Windows. Forms.Form

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeCompo nent()

'Add any initialization after the InitializeCompo nent() 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.Disp ose()
End If
End If
MyBase.Dispose( disposing)
End Sub

'Required by the Windows Form Designer
Private components As System.Componen tModel.IContain er

'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 Panel1 As System.Windows. Forms.Panel
Friend WithEvents Button1 As System.Windows. Forms.Button
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()
Me.Panel1 = New System.Windows. Forms.Panel
Me.Button1 = New System.Windows. Forms.Button
Me.Panel1.Suspe ndLayout()
Me.SuspendLayou t()
'
'Panel1
'
Me.Panel1.Contr ols.Add(Me.Butt on1)
Me.Panel1.Locat ion = New System.Drawing. Point(5, 382)
Me.Panel1.Name = "Panel1"
Me.Panel1.Size = New System.Drawing. Size(148, 37)
Me.Panel1.TabIn dex = 1
'
'Button1
'
Me.Button1.Loca tion = New System.Drawing. Point(21, 7)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing. Size(105, 22)
Me.Button1.TabI ndex = 0
Me.Button1.Text = "Button1"
'
'Form2
'
Me.AutoScaleBas eSize = New System.Drawing. Size(5, 13)
Me.ClientSize = New System.Drawing. Size(439, 451)
Me.Controls.Add (Me.Panel1)
Me.IsMdiContain er = True
Me.Name = "Form2"
Me.Text = "Form2"
Me.Panel1.Resum eLayout(False)
Me.ResumeLayout (False)

End Sub

#End Region

Private Sub Form2_Load(ByVa l sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Dim f1 As New Form1
f1.MdiParent = Me
f1.Show()

Dim f2 As New Form1
f2.MdiParent = Me
f2.Show()

End Sub
End Class
****** now for the child form
Public Class Form1
Inherits System.Windows. Forms.Form

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeCompo nent()

'Add any initialization after the InitializeCompo nent() 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.Disp ose()
End If
End If
MyBase.Dispose( disposing)
End Sub

'Required by the Windows Form Designer
Private components As System.Componen tModel.IContain er

'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 TextBox1 As System.Windows. Forms.TextBox
Friend WithEvents btnAdd As System.Windows. Forms.Button
Friend WithEvents btnEdit As System.Windows. Forms.Button
Friend WithEvents btnSave As System.Windows. Forms.Button
Friend WithEvents btnReset As System.Windows. Forms.Button
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()
Me.btnAdd = New System.Windows. Forms.Button
Me.btnEdit = New System.Windows. Forms.Button
Me.btnSave = New System.Windows. Forms.Button
Me.btnReset = New System.Windows. Forms.Button
Me.TextBox1 = New System.Windows. Forms.TextBox
Me.SuspendLayou t()
'
'btnAdd
'
Me.btnAdd.Locat ion = New System.Drawing. Point(17, 39)
Me.btnAdd.Name = "btnAdd"
Me.btnAdd.Size = New System.Drawing. Size(83, 23)
Me.btnAdd.TabIn dex = 0
Me.btnAdd.Text = "&Add"
'
'btnEdit
'
Me.btnEdit.Loca tion = New System.Drawing. Point(17, 73)
Me.btnEdit.Name = "btnEdit"
Me.btnEdit.Size = New System.Drawing. Size(80, 22)
Me.btnEdit.TabI ndex = 1
Me.btnEdit.Text = "&Edit"
'
'btnSave
'
Me.btnSave.Loca tion = New System.Drawing. Point(18, 114)
Me.btnSave.Name = "btnSave"
Me.btnSave.Size = New System.Drawing. Size(78, 21)
Me.btnSave.TabI ndex = 2
Me.btnSave.Text = "&Save"
'
'btnReset
'
Me.btnReset.Loc ation = New System.Drawing. Point(18, 150)
Me.btnReset.Nam e = "btnReset"
Me.btnReset.Siz e = New System.Drawing. Size(80, 22)
Me.btnReset.Tab Index = 3
Me.btnReset.Tex t = "Rese&t"
'
'TextBox1
'
Me.TextBox1.Loc ation = New System.Drawing. Point(142, 93)
Me.TextBox1.Nam e = "TextBox1"
Me.TextBox1.Siz e = New System.Drawing. Size(138, 20)
Me.TextBox1.Tab Index = 4
Me.TextBox1.Tex t = ""
'
'Form1
'
Me.AutoScaleBas eSize = New System.Drawing. Size(5, 13)
Me.ClientSize = New System.Drawing. Size(292, 273)
Me.Controls.Add (Me.TextBox1)
Me.Controls.Add (Me.btnReset)
Me.Controls.Add (Me.btnSave)
Me.Controls.Add (Me.btnEdit)
Me.Controls.Add (Me.btnAdd)
Me.Name = "Form1"
Me.Text = "Hotkeys!!"
Me.ResumeLayout (False)

End Sub

#End Region
Private Sub btnAdd_Click(By Val sender As System.Object, ByVal e As
System.EventArg s) Handles btnAdd.Click
Me.TextBox1.Tex t = "Add"
Config("A")
End Sub

Private Sub btnEdit_Click(B yVal sender As Object, ByVal e As
System.EventArg s) Handles btnEdit.Click
Me.TextBox1.Tex t = "Edit"
Config("E")
End Sub
Private Sub btnSave_Click(B yVal sender As Object, ByVal e As
System.EventArg s) Handles btnSave.Click
Me.TextBox1.Tex t = "Save"
Config("R")
End Sub
Private Sub btnReset_Click( ByVal sender As System.Object, ByVal e
As System.EventArg s) Handles btnReset.Click
'clear
Me.TextBox1.Tex t = ""
Config("R")
End Sub

Private Sub Config(ByVal x As String)

Select Case x
Case "A", "E"
btnAdd.Enabled = False
btnEdit.Enabled = False
btnSave.Enabled = True

Case "R"
btnAdd.Enabled = True
btnEdit.Enabled = True
btnSave.Enabled = False

End Select
End Sub

Private Sub Form1_Load(ByVa l sender As Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Config("R")
End Sub
End Class

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.742 / Virus Database: 495 - Release Date: 19/08/2004
Nov 21 '05 #2
Edwinah,

It should work on the form that is at that moment the current form, are you
sure you did this for all your forms and the act all the same?

As far as I can see are it no merged menus and I did never read something
about merged buttons.

(Did I see that you have buttons on the parent as well?)

Just my thought,

Cor

i was wondering if anyone else had observed this and if there is any
workaround or patch.

i have some screens (an mdi child forms) with the buttons &Add, &Edit,
&Save and E&xit, the idea being that the user can use Alt+A, Alt+E etc
etc

when any screen loads, Add, Edit and Exit are enabled.

if the user selects Add or Edit then the Add/Edit/Exit buttons
disabled, and the Save button is enabled.

users can keep more than one form open at a time.

what i find is that if the user has more than one child screen open,
only one of the buttons eg Alt + A on the top screen (i.e the child
with focus) works and the Alt + S does not.

what is happening here?

this is annoying because i would like the users to use the keyboard as
much as possible, not the mouse.

please help.

below is some cut and paste code for an mdi form and 2 child forms (2
* form1) with identical buttons that reproduces the issue.

form2 is the mdi parent, form1 is the child

the buttons work fine if only one form is open, but die if there are
more than one open.

regards

Edwinah63

*************md i parent **************

Public Class Form2
Inherits System.Windows. Forms.Form

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeCompo nent()

'Add any initialization after the InitializeCompo nent() 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.Disp ose()
End If
End If
MyBase.Dispose( disposing)
End Sub

'Required by the Windows Form Designer
Private components As System.Componen tModel.IContain er

'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 Panel1 As System.Windows. Forms.Panel
Friend WithEvents Button1 As System.Windows. Forms.Button
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()
Me.Panel1 = New System.Windows. Forms.Panel
Me.Button1 = New System.Windows. Forms.Button
Me.Panel1.Suspe ndLayout()
Me.SuspendLayou t()
'
'Panel1
'
Me.Panel1.Contr ols.Add(Me.Butt on1)
Me.Panel1.Locat ion = New System.Drawing. Point(5, 382)
Me.Panel1.Name = "Panel1"
Me.Panel1.Size = New System.Drawing. Size(148, 37)
Me.Panel1.TabIn dex = 1
'
'Button1
'
Me.Button1.Loca tion = New System.Drawing. Point(21, 7)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing. Size(105, 22)
Me.Button1.TabI ndex = 0
Me.Button1.Text = "Button1"
'
'Form2
'
Me.AutoScaleBas eSize = New System.Drawing. Size(5, 13)
Me.ClientSize = New System.Drawing. Size(439, 451)
Me.Controls.Add (Me.Panel1)
Me.IsMdiContain er = True
Me.Name = "Form2"
Me.Text = "Form2"
Me.Panel1.Resum eLayout(False)
Me.ResumeLayout (False)

End Sub

#End Region

Private Sub Form2_Load(ByVa l sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Dim f1 As New Form1
f1.MdiParent = Me
f1.Show()

Dim f2 As New Form1
f2.MdiParent = Me
f2.Show()

End Sub
End Class
****** now for the child form
Public Class Form1
Inherits System.Windows. Forms.Form

#Region " Windows Form Designer generated code "

Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeCompo nent()

'Add any initialization after the InitializeCompo nent() 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.Disp ose()
End If
End If
MyBase.Dispose( disposing)
End Sub

'Required by the Windows Form Designer
Private components As System.Componen tModel.IContain er

'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 TextBox1 As System.Windows. Forms.TextBox
Friend WithEvents btnAdd As System.Windows. Forms.Button
Friend WithEvents btnEdit As System.Windows. Forms.Button
Friend WithEvents btnSave As System.Windows. Forms.Button
Friend WithEvents btnReset As System.Windows. Forms.Button
<System.Diagnos tics.DebuggerSt epThrough()> Private Sub
InitializeCompo nent()
Me.btnAdd = New System.Windows. Forms.Button
Me.btnEdit = New System.Windows. Forms.Button
Me.btnSave = New System.Windows. Forms.Button
Me.btnReset = New System.Windows. Forms.Button
Me.TextBox1 = New System.Windows. Forms.TextBox
Me.SuspendLayou t()
'
'btnAdd
'
Me.btnAdd.Locat ion = New System.Drawing. Point(17, 39)
Me.btnAdd.Name = "btnAdd"
Me.btnAdd.Size = New System.Drawing. Size(83, 23)
Me.btnAdd.TabIn dex = 0
Me.btnAdd.Text = "&Add"
'
'btnEdit
'
Me.btnEdit.Loca tion = New System.Drawing. Point(17, 73)
Me.btnEdit.Name = "btnEdit"
Me.btnEdit.Size = New System.Drawing. Size(80, 22)
Me.btnEdit.TabI ndex = 1
Me.btnEdit.Text = "&Edit"
'
'btnSave
'
Me.btnSave.Loca tion = New System.Drawing. Point(18, 114)
Me.btnSave.Name = "btnSave"
Me.btnSave.Size = New System.Drawing. Size(78, 21)
Me.btnSave.TabI ndex = 2
Me.btnSave.Text = "&Save"
'
'btnReset
'
Me.btnReset.Loc ation = New System.Drawing. Point(18, 150)
Me.btnReset.Nam e = "btnReset"
Me.btnReset.Siz e = New System.Drawing. Size(80, 22)
Me.btnReset.Tab Index = 3
Me.btnReset.Tex t = "Rese&t"
'
'TextBox1
'
Me.TextBox1.Loc ation = New System.Drawing. Point(142, 93)
Me.TextBox1.Nam e = "TextBox1"
Me.TextBox1.Siz e = New System.Drawing. Size(138, 20)
Me.TextBox1.Tab Index = 4
Me.TextBox1.Tex t = ""
'
'Form1
'
Me.AutoScaleBas eSize = New System.Drawing. Size(5, 13)
Me.ClientSize = New System.Drawing. Size(292, 273)
Me.Controls.Add (Me.TextBox1)
Me.Controls.Add (Me.btnReset)
Me.Controls.Add (Me.btnSave)
Me.Controls.Add (Me.btnEdit)
Me.Controls.Add (Me.btnAdd)
Me.Name = "Form1"
Me.Text = "Hotkeys!!"
Me.ResumeLayout (False)

End Sub

#End Region
Private Sub btnAdd_Click(By Val sender As System.Object, ByVal e As
System.EventArg s) Handles btnAdd.Click
Me.TextBox1.Tex t = "Add"
Config("A")
End Sub

Private Sub btnEdit_Click(B yVal sender As Object, ByVal e As
System.EventArg s) Handles btnEdit.Click
Me.TextBox1.Tex t = "Edit"
Config("E")
End Sub
Private Sub btnSave_Click(B yVal sender As Object, ByVal e As
System.EventArg s) Handles btnSave.Click
Me.TextBox1.Tex t = "Save"
Config("R")
End Sub
Private Sub btnReset_Click( ByVal sender As System.Object, ByVal e
As System.EventArg s) Handles btnReset.Click
'clear
Me.TextBox1.Tex t = ""
Config("R")
End Sub

Private Sub Config(ByVal x As String)

Select Case x
Case "A", "E"
btnAdd.Enabled = False
btnEdit.Enabled = False
btnSave.Enabled = True

Case "R"
btnAdd.Enabled = True
btnEdit.Enabled = True
btnSave.Enabled = False

End Select
End Sub

Private Sub Form1_Load(ByVa l sender As Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Config("R")
End Sub
End Class

Nov 21 '05 #3
Hi Mick,

many thanks for your code solution. i checked and i am on .net
framework 1.1 so the service pack for .net 1.0 does not work!

have cut and pasted your code however, and it works v well.

regards

Edwinah63
Nov 21 '05 #4

"Edwinah63" <ed*****@custom ercare.com.au> wrote in message
news:d7******** *************** ***@posting.goo gle.com...
many thanks for your code solution. i checked and i am on .net
framework 1.1 so the service pack for .net 1.0 does not work!


He didn't say anything about 1.0. He mentioned Service Pack 1, and since 1.0
is on SP3, it's more than likely he WAS referring to 1.1.
Nov 21 '05 #5
Yes I was refering to 1.1.
I don't know if it's in the automatic updates yet though.

---- Wrapped Link -------------------------
http://www.microsoft.com/downloads/d...displaylang=en
---------------------------------------------

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Jeff Johnson [MVP:VB]" <i.***@enough.s pam> wrote in message
news:OL******** *****@TK2MSFTNG P11.phx.gbl...

"Edwinah63" <ed*****@custom ercare.com.au> wrote in message
news:d7******** *************** ***@posting.goo gle.com...
many thanks for your code solution. i checked and i am on .net
framework 1.1 so the service pack for .net 1.0 does not work!


He didn't say anything about 1.0. He mentioned Service Pack 1, and since
1.0 is on SP3, it's more than likely he WAS referring to 1.1.

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.742 / Virus Database: 495 - Release Date: 19/08/2004
Nov 21 '05 #6

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

Similar topics

1
1970
by: rdshultz | last post by:
I'm a complete newbie. Need to insert a Company logo into a database column to use later on in a check printing application. Read how to insert the pointer instead of the object into the column. Below is what I did: SET QUOTED_IDENTIFIER OFF GO INSERT INTO BankInfo (CoLogo) VALUES(0xFFFFFFFF)
4
2722
by: blabore | last post by:
I have a MDI windows forms application that uses a toolbar on the parent form. I've also setup a context menu on this form to be used as the dropdown menu for one of the toolbar buttons. However, the shortcut keys for the context menu do not seem to work for the menus, only clicking on them. Is it possible to use shortcuts this way, or will...
5
1603
by: Rudy | last post by:
I am desperately seeking some help with a program that was supposed to have been completed last night. I have only been working with PHP for a week. I have tried and tried and tried, but I am unable to get this program to work. I posted a question earlier this week "Linking Query Results to a webpage", however I could never figure out where to...
15
4388
by: Richard Hollenbeck | last post by:
I tried to ask this question before on the 14th of January but I never got a reply. I'm still struggling with the problem. I'll try to rephrase the question: I have a crosstab query with rows of students and columns of activities and the data are the students' scores in each activity. No problem, almost. The problem is that there are...
0
3896
by: chrisben | last post by:
Hi, Developing Env: .NET Studio in C#, windows 2000 target: a COM object used for excel user (RTD) I have no problem to compile and run the project in my machine. The excel is working great with RTD calls. It seems when I compile, the dll is registered by the Studio to GAC. However, I got some issues when I try to deploy it to
5
5860
by: Edwinah63 | last post by:
Hi everyone, i was wondering if anyone else had observed this and if there is any workaround i have a screen (an mdi child form) with the buttons &Add, &Edit, &Save and E&xit, the idea being that the user can use Alt+A, Alt+E etc etc when the screen loads, Add, Edit and Exit are enabled.
0
999
by: Corobori | last post by:
Hi, I am having some problems using InstallShield Express to create a patch for my application, a Windows vb.net project. If you have some experience in that area and some spare time I would appreciate some help. http://community.installshield.com/showthread.php?t=143588 http://community.installshield.com/showthread.php?t=143592
10
1727
by: Susan Baker | last post by:
Hi Guys (and girls), I am in a bit of a bind. I'm looking for a simple "proof of concept" C# app (WinForm OR console) that sends a web request to a simple PHP script and receives BINARY data back from the PHP script. Binary data is necessary because I want to be able to send files as well as compressed (zipped) data. The example PHP...
6
3887
by: =?Utf-8?B?L2Rldi9udWxs?= | last post by:
Hello, i am using visual studio 2003 enterprise architect version. I am making apps for the .Net framework 1.1. While testing an interface, i discovered something strange. In this application we have a standard toolbar that is at the top of the form window. It contains about 8 buttons that use images from an imagelist. Sometimes we hide...
0
7484
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7415
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7675
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7928
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7775
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
4963
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3451
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1902
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1030
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.