4 Replies - 923 Views - Last Post: 02 December 2014 - 06:38 AM Rate Topic: -----

#1 bhavesh97   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 28-November 14

How to generate .exe for runtime generated Form

Posted 28 November 2014 - 11:57 PM

I have made a program where user can make a form on click of a button. He can customize the form and put buttons etc.. in it. It's like a small Software Maker. But how will the user save the generated Form and it's changes? Pls help me.

Here is the code which runs when the button is clicked:
Dim NF As Windows.Forms.Form
NF = (Windows.Forms.Form)
NF.Visible = True
NF.Background = Color.Gray


Pls suggest any methods of code to put in the Save Form button for the user to make a new stanalone Application.

Thanking in advance.

Is This A Good Question/Topic? 0
  • +

Replies To: How to generate .exe for runtime generated Form

#2 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 15679
  • View blog
  • Posts: 62,783
  • Joined: 12-June 08

Re: How to generate .exe for runtime generated Form

Posted 29 November 2014 - 12:40 AM

Save the information to a local text file, database, or the my.settings.
Was This Post Helpful? 1
  • +
  • -

#3 thecoat   User is offline

  • D.I.C Addict

Reputation: 153
  • View blog
  • Posts: 537
  • Joined: 07-December 13

Re: How to generate .exe for runtime generated Form

Posted 29 November 2014 - 11:33 AM

You can use the vb.net compiler vbc.exe (developers command prompt is the easiest way to find it) and pass it a source file name. The trick is going to be in generating the source file you need to pass it. Depending on the level of complexity of what you are allowing the user to do this could get quite involved. It would also be worth while to examine a new winforms project (generated off the template) and look at the vs designer generated code, as you'd need to write some of this out to a source file as well. You could possibly examine the user created form with reflection however in the process of building the form it would be better to work with the user choices then. I'd create an object to hold the pertinent information so that when the user is finished the object could be used to generate the source file code.

Allowing the user to go back later and make changes would be an entirely different animal, and you may want to save your own custom template format again with the needed properties and settings allowing you to regenrate code files, this is where something like xml serialization of a class would come in handy as the same object you create to store your pertinent form details could be setup to enable it to be serialized out to an xml file to save your user projects pre-compile.

This post has been edited by andrewsw: 29 November 2014 - 02:26 PM
Reason for edit:: split para

Was This Post Helpful? 1
  • +
  • -

#4 bhavesh97   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 28-November 14

Re: How to generate .exe for runtime generated Form

Posted 01 December 2014 - 07:36 AM

Thankyou @thecoat and @modi123_1 . These methods helped a lot, though they are too long to be implimented quickly. It's becoming like I'm creating a small IDE like VB itself.

Thnks a lot again
Was This Post Helpful? 0
  • +
  • -

#5 maceysoftware   User is offline

  • Member Title
  • member icon

Reputation: 394
  • View blog
  • Posts: 1,656
  • Joined: 07-September 13

Re: How to generate .exe for runtime generated Form

Posted 02 December 2014 - 06:38 AM

Hello bhavesh97,

The question you are posing is in itself asking to write a IDE like visual studio.

However it doesn't have to be.

If you went down the route of thecoat you will need to create a IDE.

However Modi is giving you another way of doing it.

Instead of trying to create a program that you can generate a exe from how about making a self generating application.

THIS IS NOT EASY AND ALOT OF GOOD DEVELOPERS HAVE FAILED - also the idea is just a bad one in the eyes of a developer as it kinda puts developers out of a job, at least for data entry applications.

So the base application you would sell would have your set-up screens and system data in your database.

Administrator users would be able to log in use your set-up screens to change, create or delete forms.

While other users will be able to log in to use the screens the administrators has created.

You would need to keep alot of information about the form for example control location, control parent, control size. ect ect

How you launch the form, ect ect

You could even let the users link into another database of their choosing and bring back data from their own systems.

I am not kidding when i say this will not be easy but its the only other way i see about doing it other than creating a IDE.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1