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

M

Marc

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
 
T

Tom Shelton

Marc said:
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...
 

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