|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Need a way for the user to add form buttons??????????????????????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 wrote:
Show quoteHide quote > Hi, Adding a button dynamically isn't that difficult:> > 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 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 Thanks again Tom!
I'll have a play around with that. Tom Shelton wrote: Show quoteHide quote > 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
OO design and programming...
Upgrade Question Q: Regular Expressions? tell more about .net framework date time picker and validate event ( is this a bug ? ) Drag and drop multiple button controls..need help modifying code please??? Managing without .NET for runtime applications Automatic Form Fill in SQL connection problem Looking For Training Recommendations |
|||||||||||||||||||||||