add button in run time
-
i have table in DB (id,name) and have form with panel if i have 5 names in table have 5 buttons in this panel each one beside each other i want if user add any row in this table dynamically when form load add button beside last one to the end of panel and if add another add at bottom of this buttons and sidebar appear it's difficult to make this buttons add in runtime beside other ... and table can contain 100 rows :S:S so plz i need help in this :)
-
i have table in DB (id,name) and have form with panel if i have 5 names in table have 5 buttons in this panel each one beside each other i want if user add any row in this table dynamically when form load add button beside last one to the end of panel and if add another add at bottom of this buttons and sidebar appear it's difficult to make this buttons add in runtime beside other ... and table can contain 100 rows :S:S so plz i need help in this :)
Mohamed Nabawy wrote:
it's difficult to make this buttons add in runtime beside other
No it isn't, but I expect you will run out of room and I doubt your users will like it. Maybe you want a ComboBox or a TabControl?
-
Mohamed Nabawy wrote:
it's difficult to make this buttons add in runtime beside other
No it isn't, but I expect you will run out of room and I doubt your users will like it. Maybe you want a ComboBox or a TabControl?
-
Mohamed Nabawy wrote:
it's difficult to make this buttons add in runtime beside other
No it isn't, but I expect you will run out of room and I doubt your users will like it. Maybe you want a ComboBox or a TabControl?
-
i have table in DB (id,name) and have form with panel if i have 5 names in table have 5 buttons in this panel each one beside each other i want if user add any row in this table dynamically when form load add button beside last one to the end of panel and if add another add at bottom of this buttons and sidebar appear it's difficult to make this buttons add in runtime beside other ... and table can contain 100 rows :S:S so plz i need help in this :)
-
i need if row add automatic add button in runtime and be fixed once another row added not every time add all rows in runtime ? ... are this available ?
-
Mohamed Nabawy wrote:
my boss need this
Bosses rarely know what they need or want. :-D Most times you need to tell them what they need. Adding a Button at runtime is easy: 0) Instantiate it 1) Set the Text 2) Set the Location 3) Attach event handlers as needed 4) Add it to the Controls collection of the parent (Form)
System.Windows.Forms.Button b = new System.Windows.Forms.Button () ;
b.Text = "Push me" ;
b.Location = new System.Drawings.Point ( x , y ) ;
b.Click += someclickhandler ;
this.Controls.Add ( b ) ;