Solved

dynamically controlling GUI

Posted on 2002-03-19
8
185 Views
Last Modified: 2011-09-20
I want to dynamically create the GUI in Visual basic 6.0 from XML.
Can somebody help me

Thanks for answer
 But I need to add 15 controls.How can I trap events for all such controls
0
Comment
Question by:ngomte
8 Comments
 
LVL 2

Accepted Solution

by:
ronenr earned 100 total points
ID: 6879552
The following code is an example of adding a label dynamicly, you must put on your form a label with the name Label0 and set its index to zero, the rest of the labels will be created dynamically.
In the example iCount is the number of the label that we are creating.

Call Controls.Add("VB.Label", "Label_name", form1)
   Load Label0(iCount)
   Set Label0(iCount).Container = form1
     With Label0(iCount)
            .Visible = True
            .Width = 800
            .Top = 200
            .Tag = .Top
            .Left = 100
            .Height = 195
            .Caption = "label test"
        End With

  Controls.Remove "Label_name


you can find a full example in the following address:

http://www.thescarms.com
0
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 6879553
you will need to create controls at run-time: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q190670
0
 
LVL 9

Expert Comment

by:kprestage
ID: 6879873
by using control arrays like suggested by ronenr, you would  trap the events for the controls by putting code in the event on your form.  If you have a label name lblDynamic(0) on your form, you can then add more labels like lblDynamic on the form using ronenrs example.  To code against the other controls, you would put the code in the events for lblDynamic(0).  The index parameter in the even will let you know which actual lblDynamic fired the event.
0
 
LVL 4

Expert Comment

by:WolfgangKoenig
ID: 6880286
I working on a GridLayoutManager, where you only must specify the grid coords for a dialog item on a vb form...

Perhaps for you of interest ...
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:ngomte
ID: 6993101
I did not get the specicfic answer.
0
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 7060581
This question appears to be abandoned. A question regarding it will be left in the Community Support
area; if you have any comment about the question, please leave it here.

Unless there is objection or further activity, one of the moderators will be asked to splits points between <emoreau> and ronenr .

The link to the Community Support area is:
http://www.experts-exchange.com/jsp/qList.jsp?ta=commspt

DO NOT ACCEPT THIS COMMENT AS AN ANSWER.
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7065663
ngomte ->  You logged in recently, and I am about to process a point split between the two recommended experts for the help given here.  Please provide feedback, since help was requested, help given and .... we wait.  It is most helpful for your to respond to each expert as they givew you recommendations in terms of the results so you can achieve your goal and award those who help you in a timely manner.

Listening further.

Moondancer - EE Moderator
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7078356
Thanks, point split, item closed.

Points for emoreau ->  http://www.experts-exchange.com/jsp/qShow.jsp?qid=20311742

ngomte  Date: 05/06/2002 11:16PM PST  ->  I did not get the specicfic answer.  

In the future, please remain active in all your questions here and be specific in your response to the experts in terms of your needs and what you feel is lacking.  This will help you reach your goal more quickly and eliminate time waste on everyone's behalf.  If you respond to each comment added for you with the results, clearly, the process will be expedited.

Thanks,

Moondancer - EE Moderator
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now