473,385 Members | 1,727 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,385 software developers and data experts.

Shortcuts on Buttons vb.net - strange behaviours

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.

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

what i find is that the shortcut Alt+A is the only one that works, the
others just do not respond.

what is happening here?

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

please help

regards

Edwinah63
Nov 21 '05 #1
5 5850
Hai Edwin,

I have worked on such cases, but never i have come accross such problems.....

check whehter u have assigned those hot keys for some other things also.

Nov 21 '05 #2
Experimentation may help. Try. disabling all the shortcuts except one of the
ones which currently does not work, test this with other keys and then
combinations until a pattern emerges

--

OHM ( Terry Burns )
. . . One-Handed-Man . . .
If U Need My Email ,Ask Me

Time flies when you don't know what you're doing

"Edwinah63" <ed*****@customercare.com.au> wrote in message
news:d7**************************@posting.google.c om...
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.

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

what i find is that the shortcut Alt+A is the only one that works, the
others just do not respond.

what is happening here?

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

please help

regards

Edwinah63

Nov 21 '05 #3
* ed*****@customercare.com.au (Edwinah63) scripsit:
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.

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

what i find is that the shortcut Alt+A is the only one that works, the
others just do not respond.

what is happening here?

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


Can you provide a test project somewhere and post a link to it?

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
Nov 21 '05 #4
Hi Herfried,

here is some cut and paste code for an mdi form and 2 forms with
identical buttons that reproduces the issue.

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

form2 is the mdi parent, form1 is the child

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

look forward to your response
Edwinah63

*************mdi 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.
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 Panel1 As System.Windows.Forms.Panel
Friend WithEvents Button1 As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
Me.Panel1 = New System.Windows.Forms.Panel
Me.Button1 = New System.Windows.Forms.Button
Me.Panel1.SuspendLayout()
Me.SuspendLayout()
'
'Panel1
'
Me.Panel1.Controls.Add(Me.Button1)
Me.Panel1.Location = New System.Drawing.Point(5, 382)
Me.Panel1.Name = "Panel1"
Me.Panel1.Size = New System.Drawing.Size(148, 37)
Me.Panel1.TabIndex = 1
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(21, 7)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(105, 22)
Me.Button1.TabIndex = 0
Me.Button1.Text = "Button1"
'
'Form2
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(439, 451)
Me.Controls.Add(Me.Panel1)
Me.IsMdiContainer = True
Me.Name = "Form2"
Me.Text = "Form2"
Me.Panel1.ResumeLayout(False)
Me.ResumeLayout(False)

End Sub

#End Region

Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) 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.
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 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.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
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.SuspendLayout()
'
'btnAdd
'
Me.btnAdd.Location = New System.Drawing.Point(17, 39)
Me.btnAdd.Name = "btnAdd"
Me.btnAdd.Size = New System.Drawing.Size(83, 23)
Me.btnAdd.TabIndex = 0
Me.btnAdd.Text = "&Add"
'
'btnEdit
'
Me.btnEdit.Location = New System.Drawing.Point(17, 73)
Me.btnEdit.Name = "btnEdit"
Me.btnEdit.Size = New System.Drawing.Size(80, 22)
Me.btnEdit.TabIndex = 1
Me.btnEdit.Text = "&Edit"
'
'btnSave
'
Me.btnSave.Location = New System.Drawing.Point(18, 114)
Me.btnSave.Name = "btnSave"
Me.btnSave.Size = New System.Drawing.Size(78, 21)
Me.btnSave.TabIndex = 2
Me.btnSave.Text = "&Save"
'
'btnReset
'
Me.btnReset.Location = New System.Drawing.Point(18, 150)
Me.btnReset.Name = "btnReset"
Me.btnReset.Size = New System.Drawing.Size(80, 22)
Me.btnReset.TabIndex = 3
Me.btnReset.Text = "Rese&t"
'
'TextBox1
'
Me.TextBox1.Location = New System.Drawing.Point(142, 93)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(138, 20)
Me.TextBox1.TabIndex = 4
Me.TextBox1.Text = ""
'
'Form1
'
Me.AutoScaleBaseSize = 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(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnAdd.Click
Me.TextBox1.Text = "Add"
Config("A")
End Sub

Private Sub btnEdit_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnEdit.Click
Me.TextBox1.Text = "Edit"
Config("E")
End Sub
Private Sub btnSave_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnSave.Click
Me.TextBox1.Text = "Save"
Config("R")
End Sub
Private Sub btnReset_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnReset.Click
'clear
Me.TextBox1.Text = ""
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(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Config("R")
End Sub
End Class
Nov 21 '05 #5
Have i been forgotten? can someone please help me here.
Nov 21 '05 #6

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

Similar topics

4
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,...
3
by: Douglas Buchanan | last post by:
Buttons don't work if form is opened on startup A2k If 'frmMain' is set to open by default at startup none of the buttons work. If 'frmMain' is opened from the database window then all the...
5
by: Edwinah63 | last post by:
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,...
1
by: Jason Hunt | last post by:
Hello All, I have a form with some text boxes and buttons. The buttons have shortcuts in their text labels, such as "&Add". When the user is still focused on the textbox and presses Alt-A,...
2
by: lottoman | last post by:
Hi all, Is it possible to define shortcuts for toolbarbuttons? Can I also get the underscore underneath the specified letter? Thanks
1
by: Orwell | last post by:
Hi -- I have a web page and my user wants to have shortcuts added to a couple of buttons on the page so that the end-user does not need to use the mouse to process. I am using IE, so I can use the...
0
by: Zytan | last post by:
I cannot use & to implement a keyboard shortcut on a TabPage like I can on a Button. Is there a way to easily do this? Maybe TabPages aren't supposed to have keyboard shortcuts, but it would be...
6
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...
8
by: panjap | last post by:
hi, i have a problem with my keyboard, whereby all the shortcuts are messed, up. My shift button is messed up, and does not work, e.g pressing 1 and shoft does not get the exclamation mark, and it...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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?
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
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...
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.