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

  • Thread starter Thread starter Marc
  • Start date Start date
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
 
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...
 
Back
Top