creating controls at runtime

G

Guest

Well thanks to all of you my layout designer is moving along (slowly as I learn). I want to be able to give the user the ability to add label controls at runtime. I have this working for one label control, Label1. When the user adds the next label I would like my code to check (maybe a loop?) what the next available label number is and then create it. So if Label1 exists then the next one would be label2. I read a pretty good MSDN article but it lost me near the end. I also want the labels to be movable and resizable. I am using a context menu to set the size of label1 and mouse_down, mouse_move and mouse_up events to control the movement. This works also for Label1. I would like this code to be automatically created when the user adds a label

Thank you
John
 
H

Herfried K. Wagner [MVP]

* "=?Utf-8?B?amNyb3VzZQ==?= said:
Well thanks to all of you my layout designer is moving along (slowly
as I learn). I want to be able to give the user the ability to add label
controls at runtime. I have this working for one label control,
Label1. When the user adds the next label I would like my code to check
(maybe a loop?) what the next available label number is and then create
it.

I would store the label count in a variable.
So if Label1 exists then the next one would be label2. I read a pretty
good MSDN article but it lost me near the end. I also want the labels to
be movable and resizable. I am using a context menu to set the size of
label1 and mouse_down, mouse_move and mouse_up events to control the
movement. This works also for Label1. I would like this code to be
automatically created when the user adds a label.

Have a look at 'AddHandler' and 'RemoveHandler' and the event handler's
'sender' parameter.
 
G

Guest

This Idea has been scrapped due to lack of programmer ability. A new direction has been taken

Thanks
John
 
H

Herfried K. Wagner [MVP]

* "=?Utf-8?B?amNyb3VzZQ==?= said:
This Idea has been scrapped due to lack of programmer ability. A new direction has been taken.

What direction?

If you have any further questions, feel free to post them to this group.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top