Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi I am using a treeview to enable the user to run code that runs a sql
query, has anyone got any idea how to prevent the user selecting another node while the code is still running. TIA Charles |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You could prevent users selecting another via the keyboard by doing this in
the KeyDown event: if bSQLRunning then KeyCode = 0 Exit Sub end if Preventing this is more difficult when the user uses the mouse and you will need some code to keep track of the previously selected node and then return to that. This couild be done with a private node variable that gets set in the node_click event. So, you would get something like this: Private oLastNode as Node Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node) if bSQLRunning then oLastNode.Selected = True Exit Sub else Set oLastNode = TreeView1.SelectedItem end if Simplest would be to just set the Enabled property of the treeview temporarily to False. RBS "vqthomf" wrote in message ... Hi I am using a treeview to enable the user to run code that runs a sql query, has anyone got any idea how to prevent the user selecting another node while the code is still running. TIA Charles |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
TreeView | Excel Programming | |||
TreeView Help | Excel Programming | |||
Treeview | Excel Programming | |||
How to Treeview in VBA | Excel Programming | |||
Treeview | Excel Programming |