473,320 Members | 1,991 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,320 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 2166
* "=?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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.