473,388 Members | 1,342 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

creating controls at runtime

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
3 2167
* "=?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
This Idea has been scrapped due to lack of programmer ability. A new direction has been taken

Thanks
John
Nov 20 '05 #3
* "=?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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: dfreas | last post by:
I'm using Bloodshed Dev-C++ to write a program used to calculate orders for my business. Until recently a command line program has been sufficient but it is beginning to become cumbersome so I've...
0
by: Sinisa | last post by:
I have a Windows form which has multiple groups of the same window controls. I wanted to create a control class that has the standard controls in one. something like: public class Sensor :...
1
by: rp | last post by:
Hi, How would I create runtime tabpages with runtime controls(textBoxes,comboBox, checkedListBox), inserting,deleting, and modifing the tabpages whenever I want to in C#? Thanks in advance. rp
15
by: Carlos Lozano | last post by:
Hi, What is the right way to create an OCX COM component. The component is already registerred, but can't create an instance. I am using the reference to the interop module created. If I use...
2
by: Anand Sagar | last post by:
I have a Panel1 and button1 on my webform. At runtime, I create 2 textboxes. I do it at the Page_Load event. I put the code within the " If Not isPostBack" For the button click event, I will do...
8
by: Jason | last post by:
Hi everyone, Have a small problem which I hope you can help me with. I'm trying to create several link buttons at runtime which run a routine when clicked. I've tried to create a VERY basic...
12
by: Mats Lycken | last post by:
Hi, I'm creating a CMS that I would like to be plug-in based with different plugins handling different kinds of content. What I really want is to be able to load/unload plugins on the fly without...
7
by: Varangian | last post by:
Hello is creating controls at runtime the same as designtime ? will a page be faster if controls are created at designtime rather than at runtime ? If so why ? thanks :)
5
by: Kristen | last post by:
I am using ASP.Net 2.0 and I need to create a web page on the fly based on what information is in the database. The page is going to have certain controls like text boxes and labels and buttons. ...
5
by: Guillaume BRAUX | last post by:
Hello, What I want to do is to add a userControl to a form class witch is a different class from the one the button is generated. For example, I want to instanciate a label in "class1" and add...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.