Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command button to open and expand a treeview

Status
Not open for further replies.

ixian

Programmer
Jul 13, 2001
128
US
Hello,

I have a treeview that I wish it to be hidden on form load but once some clicks on a command button to open it up below the button on a single click(double click to close it).

Is this possible?

Aaron
 
I'm not sure if I understood what you want...
For what I understood you want to make a treeview visible when you click a cmdbutton and invisible when you double click it?
If so just place on the click event of your cmdbutton:
tvw.Visible=True

and on the double click:
tvwVisible=False

Then if you want to expand all the nodes just do:

For i=1 to tvw.Nodes.Count

tvw.Nodes(i).Expanded=true

Next i

If you want to position your treeview below the button just do:

tvw.Left=cmd.Left
tvw.Top=cmd.Top+cmd.Height

Hope this helps
 
Yes this is what I want..but there is not a dblclick procedures for cmd buttons...it go to general if i type it in
Private Sub cmd1_dblclick

does nothing

Should i use toggle button or check box command

Aaron
 
oops, you're right, didn't even remembered that...
Well you can use a check box to that, or you can still use a cmdbutton let's say with left click to show the treeview and right click to hide it.

You could also simulate a dblclick on a cmdbutton using a timer to count the time between to clicks, but that wouldn't be necessary I think. I myself would go with the check box option.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top