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

Change the size of Tree View elements in Visual FoxPro

Status
Not open for further replies.

Miraziz

Programmer
Sep 21, 2020
1
0
0
PL
Hi, I'm new in FoxPro, I'm making a desktop application to automate ordering product in the shop.

I have different types of elements to choose from to complete the order form, at first I've tried to use checkboxes for selection, but users will be making the order using a touch-screen and I need to have bigger elements, so I ended up with labels (Webdings2) and changing their back color onClick. By clicking some elements I need to show their child elements (just like in the tree view). My issue is that I have several different forms to be completed and they are pretty the same, by the end of completion of the form I need to validate the application (if the user has marked every required field). I could hard-coded it, but later on, I might need to add a new form or someone else would need to add my solution to his software, and the code is getting bigger the same, so it is going to be very messy. I wanted to use the tree view instead, but I cannot find the way how to change the size of the elements. Can anyone suggest to me what can I do in this case, or maybe another way of solving this solution?
 
Miraziz, first of all, welcome to the forum (and to Visual Foxpro).

Before we talk about treeviews, let me pick up your point about needing the same code for several different forms and possibly for other developers. That is a classic use case for object orientation. In short, you create a class that contains the user interface elements that you need, along with the validation code. Once you have done that, you can drop the class onto any form, at which point the form will acquire all the functionality that you have defined.

I would think that your class would be based on a container class, which in turn would contain the labels or checkboxes or whatever else you need. However, that's just off the top of my head. It would need further analysis of the problem before going into any detail.

It would be well beyond the scope a forum post to explain how object orientation works and how to use it in VFP, but I strongly recommend that you at least read up on the subject and familiarise yourself with the concept.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Miraziz,
I favour Mike's remarks about to familiarise with object orientation. I also think that the API treeview is not such a good idea to be used with a tough-screen application. Please study the concept by Burkhard Stiller, he constructed a tree-view with pure VFP code, thus enabling you to make it with node size to a size which is workable with a tough-screen. Stay healthy,
Koen
 
You can change the font size and name to be used in a Treeview control. When you add the control to the form, right-click on the control and then select the properties. This will open a new window with the properties that can be set; select the tab 'Font' and you can set the size. See the image below.

2020-09-25_17-46-57_imjibr.jpg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top