473,804 Members | 3,909 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Up Down Arrows as TAB Key

Bob
Hello:

I'm tring to make the down arrow act as a tab key and the up arrow act as
like (-TAB.).

I have this for the down arrow but nothing happens.

Protected Overrides Function ProcessDialogKe y(ByVal keyData As Keys) As
Boolean
MyBase.ProcessD ialogKey(keyDat a)
If keyData = System.Windows. Forms.Keys.Down Then
keyData = System.Windows. Forms.Keys.Tab
End If
End Function
TIA

Bob
Nov 21 '05 #1
10 7182
Put the call to the MyBase.ProcessD ialogKey(keyDat a) AFTER the if
statement.

Protected Overrides Function ProcessDialogKe y(ByVal keyData As
System.Windows. Forms.Keys) As Boolean
If keyData = Keys.Down Then
keyData = Keys.Tab
End If
MyBase.ProcessD ialogKey(keyDat a)
End Function
"Bob" <no****@nospamm ers.com> wrote in message
news:C2hRe.2681 6$FL1.13685@trn ddc09...
Hello:

I'm tring to make the down arrow act as a tab key and the up arrow act as
like (-TAB.).

I have this for the down arrow but nothing happens.

Protected Overrides Function ProcessDialogKe y(ByVal keyData As Keys) As
Boolean
MyBase.ProcessD ialogKey(keyDat a)
If keyData = System.Windows. Forms.Keys.Down Then
keyData = System.Windows. Forms.Keys.Tab
End If
End Function
TIA

Bob

Nov 21 '05 #2
Bob
Some Guy:

Strange how my original post didn't show up where I intended. Thanks for the
response despite my screw up.

Your sugextion looks like it should work based on other articles. I'm
thinking I'm missing one little bit of this. Maybe I'm putting it in the
wrong place in my code.

I tried calling it from a controle like this

Dim MyKey As System.Windows. Forms.Keys
MyBase.ProcessD ialogKey(MyKey)

Yet nothing happens. I would like it to work through out the whole form. Do
I need to raise the event somewhere? Also, will it slow things down or would
I be better to try to convince the client to use traditional methods to
navigate the controles. Please keep in mind I have 327 controles.

Thanks Again

TIA

Bob
Nov 21 '05 #3
This code sets MyKey to none. So nothing happens.

Dim MyKey As System.Windows. Forms.Keys
MyBase.ProcessD ialogKey(MyKey)

Try: Dim MyKey As System.Windows. Forms.Keys=Keys .Tab

"Bob" <no****@nospamm ers.com> wrote in message
news:ZeCRe.7650 $__1.4593@trndd c07...
Some Guy:

Strange how my original post didn't show up where I intended. Thanks for
the response despite my screw up.

Your sugextion looks like it should work based on other articles. I'm
thinking I'm missing one little bit of this. Maybe I'm putting it in the
wrong place in my code.

I tried calling it from a controle like this

Dim MyKey As System.Windows. Forms.Keys
MyBase.ProcessD ialogKey(MyKey)

Yet nothing happens. I would like it to work through out the whole form.
Do I need to raise the event somewhere? Also, will it slow things down or
would I be better to try to convince the client to use traditional methods
to navigate the controles. Please keep in mind I have 327 controles.

Thanks Again

TIA

Bob

Nov 21 '05 #4
keyData is passed in by value, so how can you change it? I don't
believe you can change the value of an argument unless it has been
passed in by reference, so I don't believe your function will actually
change the value of keyData. In fact, I'm surprised you don't get an
exception there.

I think you have to use the focus method to change focus, something
like
If keyData = System.Windows. Forms.Keys.Down Then
cmdNextButton.F ocus()
End If
And I think you'd have to keep track of the order you want the tabs to
go in, or else search all the control properties yourself to find out
which one should get focus next and then manually set focus to that
particular control. In VB6 I've used a function (API function I think)
called SendKeys. Perhaps you can use that to send a tab to your
application whenever it sees a down arrow. I've not used it yet in
vb.net. Perhaps something like (not sure of the SendKey args):
If keyData = System.Windows. Forms.Keys.Down Then
SendKeys(applic ation.hInstance ,
System.Windows. Forms.Keys.Tab)
End If

Good luck.
Mark H.

Nov 21 '05 #5
Bob
Some Guy & Mark:

Thanks to both of you for the responses. Some Guy's response actually made
it so all the keys acted as a TAB key. However, this gave me some leads to
work with and helped me figure it out.

Mark.

I certainly see what you mean and when you look below at the code that is
working, you'll fall of your chair. I still have not fully tested it but so
far it works ok with one small yet probably resolvable issue. I've yet to
have any errors at all.

Protected Overrides Function ProcessDialogKe y(ByVal keyData As
System.Windows. Forms.Keys) As Boolean
'MyBase.Process DialogKey(keyDa ta) <<--Note that this line is
comented out.
End Function

'If I remove the above function entirely, the down arrow does nothing. Even
when I press it in other Private Subs for 'KeyDown events in other controles
and the TAB key doesn't work at all. Strange don't you think?

Private Sub Form1_KeyDown(B yVal sender As Object, ByVal e As
System.Windows. Forms.KeyEventA rgs) Handles MyBase.KeyDown
Dim MyKey As System.Windows. Forms.Keys
If e.KeyCode = Keys.Down Then
MyKey = Keys.Tab
ElseIf e.KeyCode = Keys.Tab Then
MyKey = Keys.Tab
End If
MyBase.ProcessD ialogKey(MyKey)
End Sub

The one small issue to resolve as of now is the following

I have an inherited user controle I made. It's a TextBox that I set to
MultiLine = True and ScrollBars = Verticle in my application(Not when I
built the controle). It's designed to move to the upper left portion of the
form and resize to (636, 326) when the F1 key is pressed and return to it's
original size and position when ESC is pressed. This also continues to
function as it should.

The down arrow acts as a TAB key intill it encounters my controle. When the
cursor reaches my controle, the down arrow key does nothing untill I press
the TAB key or click the next controle. Then the down arrow again functions
as the TAB key. However, the TAB key continues to function normally through
out all the controles on the form.

YEAH, I'm scratching my head too.

Bob
Nov 21 '05 #6
Bob
Mark:
I think you have to use the focus method to change focus, something like If keyData = System.Windows. Forms.Keys.Down Then
cmdNextButton.F ocus()
End If
I forgot to mention,

That would take a lot of code as I have more than 327 controles on my form
that TabStop = True. I must intercept the Down Arrow key press in the forms
KeyDown event.
If keyData = System.Windows. Forms.Keys.Down Then
SendKeys(applic ation.hInstance , System.Windows. Forms.Keys.Tab)
End If


Now thats interesting. I may able to refine my code with what you gave me.
I'll be sure and post my results.

Thank you

Bob
Nov 21 '05 #7
What's the problem?

Protected Overrides Function ProcessDialogKe y(ByVal keyData As
System.Windows. Forms.Keys) As Boolean
If keyData = Keys.Up Then
keyData = Keys.Tab
MyBase.ProcessD ialogKey(keyDat a)
End If
End Function

"Bob" <no****@nospamm ers.com> wrote in message
news:41_Re.229$ AB4.42@trnddc03 ...
Mark:
I think you have to use the focus method to change focus, something like

If keyData = System.Windows. Forms.Keys.Down Then
cmdNextButton.F ocus()
End If


I forgot to mention,

That would take a lot of code as I have more than 327 controles on my form
that TabStop = True. I must intercept the Down Arrow key press in the
forms KeyDown event.
If keyData = System.Windows. Forms.Keys.Down Then
SendKeys(applic ation.hInstance , System.Windows. Forms.Keys.Tab)
End If


Now thats interesting. I may able to refine my code with what you gave me.
I'll be sure and post my results.

Thank you

Bob

Nov 21 '05 #8
Bob
Some Guy:

There is no problem. You've been a great help. Someone else responded also
and maybe he didn't see your post so maybe he thought is wasn't resolved. He
didn't seem to think it would work at all but actually it works great. It
was just hanging on one of my inherited user controles but I fixed that too
with a little modification to my controle.

Thanks for helping

Bob
Nov 21 '05 #9
Bob
Some guy:

I'm sorry. My response was to Marks response. HEHEHE. Everything is fine.

Thanks again

Bob
Nov 21 '05 #10

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

Similar topics

4
1601
by: Jerald | last post by:
Hi. I've just installed 2.3.4 from the source on a linux box. In the interactive mode, up/down arrows do not work. When I press 'up' python prints '^[[A' and down gives '^[[B' What is wrong? Thanks, Gerald
10
7660
by: Ryan McGeary | last post by:
In a <select> drop-down, the onchange event isn't called when scrolling through the dropdown using the mouse-wheel and when crossing over a new <optgroup>. Using the example below, notice how the onchange event isn't called when mouse wheel scrolling between A3 and B1, but it works properly when scrolling between A1 and A2. E.g. ------------------------------------------
4
2158
by: DaveO | last post by:
Hi All I have no experience in JavaScript ( only html and ASP ). I would like to add a Menu ( with multi level drop down sub menu's ) to my web site. I have tried using a DHTML Menu Creation program, but find that when loaded onto a test site, the menu runs slowly.
0
1568
by: Eddie Smit | last post by:
Hi all, In our database we have a form with a subform. If this subform contains some records, but they al 'fit' in this subform one can scroll down with the mouse. But one CAN NOT SCROLL UP with the mouse again. If one wants to see the top records again in this subform you have to use the vertical scroll bar (arrows)!! (if the subform contains many records, so one can use the vertical scroll bar) the mouse wheel is working down AND UP.
1
3338
by: Richard Coutts | last post by:
I have a Continous Form with 5 or so fields for each record, in a line from left to right. Because the Contuous Form lists several records at once, the form looks pretty much like a Datasheet. So, I'd like to be able to navigate it like one when using the up/down/left/right arrow keys of the keyboard. I have the fields set with tab stop settings so that hitting the tab key moves one field to the right. The problem I'm having is when I...
0
1539
by: Jim H | last post by:
I'm trying to use an owner draw ListBox by subscribing to the DrawItem event to draw my custom control as an item in the ListBox. This event is triggered when I drag the scroll button but NOT when I click the up/down arrows on the scroll bar of the ListBox. How do I handle the user clicking the up/down arrows? Anybody have any ideas? Jim
2
10342
by: kalp suth via DotNetMonster.com | last post by:
I want to create arrows using lines on a picture in the picture box. On clicking the button "btnShowAll", the image is loaded and the lines drawn. "RGSShowAll()" calls "DrawObjs()" which does the actual drawing work. But after displaying all the arrows in a flick, the arrows disappers. I have debugged and came to know that the "Paint" event of the picturebox is refreshing the image, so the work done on the CreateGraphics created object is...
2
2535
by: Notgiven | last post by:
Assuming I find some code that allows you to drag graphics around the page, ideally, I want the relationship between two graphics to be displayed as linked arrows. For example (imagine this in graphical form): icon1 <----------> icon2 Then the user can drag icon1 around the page and the arrow will still be "connected" to to both. How would you go about doing something like that?
1
2635
by: karaballo | last post by:
Hi All, How to trap arrow key down event on MDIChild form? Form alone works fine without MDI container. I think, ToolStrip stole these arrows key down events. How I can redirect arrow key down events to my MDIForm.ActiveMdiChild?
0
9706
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9579
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10575
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10330
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10319
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6851
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4297
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
2
3816
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.