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

Set top, left from code

Status
Not open for further replies.

klasse

Programmer
Jan 12, 2004
32
0
0
SE
Hi,

I am trying to design a form similar to a tree structure.
Then I have

My Database
|_products
|_provider

I want to click on products and I should have

My Database
|_products
| |
| |_add new product
| |_edit a product
| |_view all products
|
|_provider

Now, is there anyway to place the boxes from code? and if so, does it have something to do with the resolution used?

Thanks,

Klasse
 
Klasse,
There is a TreeView control that you might want to look into, it would save alot of work here.

But to answer your question, yes, you can set the .Left, .Top properties (along with Width/Height) to do very roughly approximate the treeview. If you get an algorithm down for where you want the controls in relation to another, then you can codify it, and when coupled with a naming convention for the controls (ie, use a numeric suffix or something of the like--think *ahead* on this aspect) you can wrap alot of the logic in loops rather than having a distinct block for each control.
--Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top