how to create new control in window application in vb.net 2.0
-
hi, i want to create table in runtime like ms word table,how can i create table? or can any one tell how to create new control which is not in toolbox i have to create new control plz help me its urgent
B.N.Thorat 9881215484 Mumbai
-
hi, i want to create table in runtime like ms word table,how can i create table? or can any one tell how to create new control which is not in toolbox i have to create new control plz help me its urgent
B.N.Thorat 9881215484 Mumbai
Unless you write some custom code to simulate a table, the closest control to use would be the DataGridView control. Creating the DataGridView behind the scense pretty difficult so I would advise you to drag one onto a windows form, set the properties and appearance like you want them then see what code Visual Studio has written behind the designer page. To add the dynamically created control to a form, reference the form then it's "Controls" property which has an "Add" method: //C# Sample this.Controls.Add(myControl,xPosition,yPosition); ' VB Sample Me.Controls.Add(myControl,xPosition,yPosition); If you are wanting a completlely new custom control, your in for a lot of graphics coding. A fairly advanced but great book on this subject is: "Pro .Net 2.0 Graphics Programming" by Eric White. Cheers! Richard
-
Unless you write some custom code to simulate a table, the closest control to use would be the DataGridView control. Creating the DataGridView behind the scense pretty difficult so I would advise you to drag one onto a windows form, set the properties and appearance like you want them then see what code Visual Studio has written behind the designer page. To add the dynamically created control to a form, reference the form then it's "Controls" property which has an "Add" method: //C# Sample this.Controls.Add(myControl,xPosition,yPosition); ' VB Sample Me.Controls.Add(myControl,xPosition,yPosition); If you are wanting a completlely new custom control, your in for a lot of graphics coding. A fairly advanced but great book on this subject is: "Pro .Net 2.0 Graphics Programming" by Eric White. Cheers! Richard
Thanks, but my requirement is not datagrid i have to create table just like in microsoft word table in which user can write text & with the text size of cell will increase like MS word table. can u suggest what should i do for such type of table? i will thankful to u thanks for ur reply.
B.N.Thorat 9881215484 Mumbai
-
Thanks, but my requirement is not datagrid i have to create table just like in microsoft word table in which user can write text & with the text size of cell will increase like MS word table. can u suggest what should i do for such type of table? i will thankful to u thanks for ur reply.
B.N.Thorat 9881215484 Mumbai
If you are wanting to create the control yourself you better have some nerve pills on hand. :) All of the functionality you mentioned will have to be created from scratch which will require a lot of paint and logic code. You will also need a good reference book. Check out: http//www.apress.com for a custom controls book. Good Luck! Richard