By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,264 Members | 1,350 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,264 IT Pros & Developers. It's quick & easy.

creating controls at runtime

P: n/a
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
Nov 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
* "=?Utf-8?B?amNyb3VzZQ==?=" <an*******@discussions.microsoft.com> scripsit:
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.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #2

P: n/a
This Idea has been scrapped due to lack of programmer ability. A new direction has been taken

Thanks
John
Nov 20 '05 #3

P: n/a
* "=?Utf-8?B?amNyb3VzZQ==?=" <an*******@discussions.microsoft.com> scripsit:
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.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.