First of all will let u know that what is control here, so there are various controls in VB.NET like TextBox, Button, Radio Button etc these all are controls.
now open ur VB.NET professional or enterprise edition which ever u have. now select 'New project' from file menu and from there Select Windows Forms Application or Empty Project From Templates...name it(textbox) and then press ok button...now from Solution Explorer right click on main project i.e. textbox(if you have given same name) and select properties option from popup menu.
now from Application tap select Class Liberary as Application type(We are doing this because we want to get output as a dll file not as a windows application.
now again from solution explorer right click on project name and select 'User Control' from Add menu. name it my_textbox.vb and press Add button to add that control, now you will be able to see that control in solution explorer.....now just start the code view of that control
which seems like
"Public Class my_textbox"
"End Class"
now you need to do is just write a line to include the textbox class which you want as a control(not necessary only textbox but you can choose any control form there.)
"Inherits system.windows.forms.textbox" and save it.....
it will look like this
"Public Class my_textbox"
"Inherits system.windows.forms.textbox"
"End Class"
now just go to desigh view again...it will show some errors...dontworry about that...just ignore that and just click on continue.....
now Click on Build My_textbox form build menu......after building it successfully, just go to the location of source folder there you can see onw textbox.dll file in Release folder. so that is what you want......
now open another windows application...now what you need to do is just drag and drop that dll file in the toolbox of that application...you can see now that a contorl named my_textbox is added in it.....now just use that as ur control......
note: like this control you can create your own control which includes properties and methods which you want to include and you can make a control like validate textbox which accepts only email or numbers or letters in that textbox which you want......
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment