By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,039 Members | 1,831 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,039 IT Pros & Developers. It's quick & easy.

Navigation buttons

lotus18
100+
P: 866
Hello World


My client wants to me to add navigation keys for the MDIChild forms (Just like a Windows Explorer). When using CTRL + F6 it would go to the next form again and again. My problem is, how can I make disable the buttons (next or back) if I reached the first or the last form? Any ideas? Thanks : )


Rey Sean
Jan 22 '08 #1
Share this Question
Share on Google+
5 Replies


debasisdas
Expert 5K+
P: 8,127
is your number of child forms fixed ?
Jan 22 '08 #2

lotus18
100+
P: 866
is your number of child forms fixed ?
What do you mean by fixed? I really have no idea about that : )
Jan 22 '08 #3

Ali Rizwan
100+
P: 927
Hello World


My client wants to me to add navigation keys for the MDIChild forms (Just like a Windows Explorer). When using CTRL + F6 it would go to the next form again and again. My problem is, how can I make disable the buttons (next or back) if I reached the first or the last form? Any ideas? Thanks : )


Rey Sean
In Explorer explorer only saves a fixed number of contents.
So declare an array or insert a list control or do some thing like that and when you open a form on its load event saves its name in that array or menu and so on. When ever u click on back it opens the last form getting his id or name from the history list and move that item to previous navigation list. I think this will help if you want some more help plz tell me so that i ll make an example for you.

Regards
>> ALI <<
Jan 22 '08 #4

lotus18
100+
P: 866
In Explorer explorer only saves a fixed number of contents.
So declare an array or insert a list control or do some thing like that and when you open a form on its load event saves its name in that array or menu and so on. When ever u click on back it opens the last form getting his id or name from the history list and move that item to previous navigation list. I think this will help if you want some more help plz tell me so that i ll make an example for you.

Regards
>> ALI <<
OK Ali, can you give me an example for this one?
Jan 22 '08 #5

Expert 5K+
P: 8,434
My client wants to me to add navigation keys for the MDIChild forms (Just like a Windows Explorer). When using CTRL + F6 it would go to the next form again and again. My problem is, how can I make disable the buttons (next or back) if I reached the first or the last form? Any ideas? Thanks : )
If the user can switch from the last to the first form directly by using the mouse, then maybe you shouldn't disallow it through the keyboard.

But in any case, how about this...

Let's say you have five child forms, called Form1 through Form5.
Create a public variable, let's say LastForm.

In each form's Deactivate event procedure, set LastMsg to Me.Name.
In the Activate event procedure for Form2, do something like...
If LastForm = "Form5"
Form5.Show
End If

And something similar, though reversed, in Form5.

This is probably an ugly way of going about it, but seems to work.
Jan 23 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.