|
-
Jul 28th, 2004, 05:25 AM
#1
Thread Starter
Frenzied Member
a Tricky problem about Enabled = true/False - Needs Experience
hi all,
I am using a listbox on a windows form to get a list of clients, when i user click on an item it should retrieve the summary of all his invoices ( so it takes some time). I am disabling the form so that user can never click on a client before finishing the previous data retrieval , so my code is like the following:
VB Code:
'in the list1.selectedindexchanged event
me.enabled = false
'''''open datareader
'''''retrieve data
'''''close datareader
me.enabled = true
it works very very fine, except for one thing.
when i click an item with the mouse, it works great but !! when i try to navigate the items in the list by using Arrows it doesn't change the selected item. i suppose that is because of the disabling of the form. So how can i force changing of selected item before applying ( me.enabled = false)
THX in Advance
BST RGDS
-
Jul 28th, 2004, 05:43 AM
#2
Hi.
I'm not sure I understand correctly. Do you want to update the screen or does the event not fire?
If you only want to update the display you should add a Me.Refresh before disabling the form.
The event should fire regardless of you use mouse or keyboard (but there's a good chance that the event fires before the display is updated when using arrowkeys)
I wish I could think of something witty to put in my sig...
...Currently using VS2013...
-
Jul 28th, 2004, 05:43 AM
#3
Fanatic Member
isnt it the case that because the form is disabled that all the controls on the form should also be disabled, You should even be able to click it with the mouse.
I am curretly building a defect management system for software and web developers,
If you wana try it out (beta test) and keep it for free just send me a message
-
Jul 29th, 2004, 02:17 AM
#4
Thread Starter
Frenzied Member
for the first answer, i used the refresh and / or Update method of the listbox before disabling the form but nothing changed , It just accepts mouse clicks and does not respond to arrow keys.
I am sure the problem is in ( me.enabled = false) because soon as i remove it, everything goes ok.
Regarding the
isnt it the case that because the form is disabled that all the controls on the form should also be disabled, You should even be able to click it with the mouse.
please let me remind you that i disable the form after the selectedindexchanged Event , and so the user has already the ability to click. the control is not disabled before clicking or keypressing.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|