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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tree view in Dialog Box 1

Status
Not open for further replies.

jackeroo75

Technical User
Aug 26, 2007
34
US
Can I create a treeview in a dialog box??

Jackeroo75
 

Don't
/
I- Of
\ /
Know Way
\ /
Any


Assuming your writing in Extra Basic.

[thumbsup2] Wow, I'm having amnesia and deja vu at the same time.
I think I've forgotten this before.


 
You might be able to cheat a tree with a listbox. If you're ok with something that looks more like an outline (or windows folders). But, it'd be possible to open and close branches. Basically, you'd need an array of all brances with some two "special charachers" to indicate how deep a branch is:

-Level 1
-- Level 1-1
--- Level 1-1-1
--+ Level 1-1-2
---- Level 1-1-2-1
-+ Level 1-2
--- Level 1-2-1

Ok, then when you display it in your list box, you run through the array and determine if it's an open branch or a closed branch. You could even set it up so that if you open 1-A it close 1-B and visa-versa.

Anyhow, all you really need to do is toggle the + and - appropriately. Once you hit a +, you don't display anything underneath it (pretty easy to determine based on the number of dashes preceeding it). Then you just build a second array based on the data toggled on and off in the first array.

Then in your dialogbox function, you can allow the user to toggle the levels based on a click or a double-click (the way EB works the best way to handle a double-click is to have it remember what was last clicked and so if it's clicked twice it opens).

But, if you want something more than that, you'd have to be more specific.
 
Thank you SKie,

I'll let you know how it goes. Thank you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top