Click here to Skip to main content
15,881,938 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I need a help i have created a form and controls on Runtime now i want to save that form in my project with controls i have added anyone please guide me .....
Posted

1 solution

There is no built in mechanism for saving a run-time created form: you will have to do it manually by traversing the form Controls collection recursively and saving the info you need to rebuild it in your application later (or by constructing "savable" information when you build the form at run time).

We can't help you much: we have no idea about your program and how it works.
 
Share this answer
 
Comments
Member 11014751 19-Aug-14 4:27am    
i am using this

Dim newform As New System.Windows.Forms.Form
newform.Text = txtfrmnme.Text
newform.Show()

in this code this is just creating a form but i want to save in my project also with the name of form i have given in textbox
OriginalGriff 19-Aug-14 4:48am    
The form is already created in your project - all you are doing is creating an new instance of it in your code. You can't "add that to your project" because it isn't a new design-time object - it's an instance of the existing design time form and it needs code to actually make it visible.

What are you trying to achieve (not what are you trying to do to display it, but why are you displaying it)? There may be a better way to do what you want.
Member 11014751 19-Aug-14 5:23am    
Please give me any reference or example to solve this problem
OriginalGriff 19-Aug-14 5:25am    
I can't "solve your problem" because I don't know what your problem is: I suspect you are trying to do something completely the wrong way, and until I know what you are trying to achieve, I can't suggest anything that will help.
Member 11014751 19-Aug-14 5:28am    
Is it possible if i can show u what i am doing on Skype or teamviewer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900