473,473 Members | 2,031 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Need a way for the user to add form buttons??????????????????????

Hi,

I am writing a program which invloves dragging and dropping things
around a form. I have so far chosen to use Buttons to drag and drop
which works fine. These button actually represent HGV's!

My problem is that I need a way to allow the user to add more 'buttons'
to the form when needed. I also need a way for the user to give these
buttons a text label.

Does anyone know a good way that I can achieve this? I know one problem
i will have is that I may need to modify my drag and drop code
automatically when each new button is added (add handler reference).

Does that makes sense??

Thanks Very Much!

Marc

Nov 23 '06 #1
2 1060

Marc wrote:
Hi,

I am writing a program which invloves dragging and dropping things
around a form. I have so far chosen to use Buttons to drag and drop
which works fine. These button actually represent HGV's!

My problem is that I need a way to allow the user to add more 'buttons'
to the form when needed. I also need a way for the user to give these
buttons a text label.

Does anyone know a good way that I can achieve this? I know one problem
i will have is that I may need to modify my drag and drop code
automatically when each new button is added (add handler reference).

Does that makes sense??

Thanks Very Much!

Marc
Adding a button dynamically isn't that difficult:

Button btn = new Button ()
btn.Text = userText.Text
' add events
addhandler btn.click, addressof theclickhandler
....
btn.location = new point (x, y)
me.controls.add (btn)

The trick is the interface for doing all of this. Maybe the
System.Windows.Forms.PropertyGrid might be of help to you...

--
Tom Shelton

Nov 23 '06 #2
Thanks again Tom!

I'll have a play around with that.
Tom Shelton wrote:
Marc wrote:
Hi,

I am writing a program which invloves dragging and dropping things
around a form. I have so far chosen to use Buttons to drag and drop
which works fine. These button actually represent HGV's!

My problem is that I need a way to allow the user to add more 'buttons'
to the form when needed. I also need a way for the user to give these
buttons a text label.

Does anyone know a good way that I can achieve this? I know one problem
i will have is that I may need to modify my drag and drop code
automatically when each new button is added (add handler reference).

Does that makes sense??

Thanks Very Much!

Marc

Adding a button dynamically isn't that difficult:

Button btn = new Button ()
btn.Text = userText.Text
' add events
addhandler btn.click, addressof theclickhandler
...
btn.location = new point (x, y)
me.controls.add (btn)

The trick is the interface for doing all of this. Maybe the
System.Windows.Forms.PropertyGrid might be of help to you...

--
Tom Shelton
Nov 23 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Pat Scott | last post by:
I am looking for a general purpose javascript snippet that enables me to <div> or <span> HTML to make portions of the form be hidden and then appear. The form contains about 12 sections and some...
19
by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate...
1
by: Eric W. Holzapfel | last post by:
Hello C#, I am trying to create an MDI app in C# (Windows Application). I have a "container" window. I would like to add more than one child window to the container (2 for starters). I would...
9
by: Bob Cummings | last post by:
Greetings I have googled this to no avail, maybe someone here can help. I have a user control that has several radio buttons and text boxes. I place 5 of these user controls on a windows form....
8
by: Tim Geiges | last post by:
Since I am being challenged with learning c# I figured I could pass some of the pain on to you guys :-) I have another question(this one is important for me to fix before I can get my app to Beta)...
13
by: tperri | last post by:
I have an HTML table with several fields like this: <A href="Savings.aspx?category=Food"><asp:imagebutton id="imgFood" ImageUrl="images\buttons\btn-food-i.gif"...
5
by: tsnyder | last post by:
I need to have an option button that allows editing to a field only when it is checked.
0
by: campwes | last post by:
Hey there. I have a user control on an aspx page that displays data based on a query (handled by another user control also on the page). I've noticed that the first time I navigate to the page...
2
by: sorobor | last post by:
dear sir .. i am using cakephp freamwork ..By the way i m begener in php and javascript .. My probs r bellow I made a javascript calender ..there is a close button ..when i press close button...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.