7 Replies - 1275 Views - Last Post: 09 June 2013 - 09:35 AM Rate Topic: -----

#1 firethebest   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 08-June 13

Creating a customizable form at runtime

Posted 08 June 2013 - 05:41 AM

Hello,

I have two different projects so far, and I would like to update certain controls (control name, picturebox image etc.) of one project from the other project. I already made the connection between the two projects.

What I have done so far was, I passed the data (text) to change certain control text accordingly. For some reason it did not update my controls text, but then I realized it doesn't matter since when the user closes the program, the controls would reset to default. (I am changing the control names at runtime.)

What I want is, from one of the project to give the user the ability to create a form to his likes (just the design) by communicating with the other project and then save that form so that the user could run the executable file again with his changes. This my all be done at runtime and the changes must be saved.

I hope you understood my question, and if not please tell me and I'll explain my self better.

Thanks in advance

Is This A Good Question/Topic? 0
  • +

Replies To: Creating a customizable form at runtime

#2 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 15300
  • View blog
  • Posts: 61,364
  • Joined: 12-June 08

Re: Creating a customizable form at runtime

Posted 08 June 2013 - 07:06 AM

Sure that's do-able. You'll need a scheme to save the control name, types, default values, and locations... Prob XML, and a scheme to read that in the form's load.... Adding them to form's controls collection.
Was This Post Helpful? 0
  • +
  • -

#3 firethebest   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 08-June 13

Re: Creating a customizable form at runtime

Posted 08 June 2013 - 07:18 AM

All right thanks for the information. I'll do some research on that. But I have one more question.

After editing the form and saved the controls names etc, if I decide to send the edited form to someone else, I would need to send the XML file as well right?

If so, can I integrate it inside the form or permanently save it so that I could just send the executable file only? Or would I need to create an exe setup file?

Thanks in advance :)
Was This Post Helpful? 0
  • +
  • -

#4 MrShoes   User is offline

  • D.I.C Addict
  • member icon

Reputation: 331
  • View blog
  • Posts: 512
  • Joined: 13-June 12

Re: Creating a customizable form at runtime

Posted 08 June 2013 - 08:47 AM

If the approach you take is for one application to save the form's layout to XML then yes, the other program would need to be able to read that XML file. It's not the only way of approaching the problem, but it would be the most accepted and easy to implement.
Was This Post Helpful? 0
  • +
  • -

#5 firethebest   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 08-June 13

Re: Creating a customizable form at runtime

Posted 08 June 2013 - 02:03 PM

Thank you both for your answers. I have used XML and it worked perfectly. Thank you
Was This Post Helpful? 0
  • +
  • -

#6 Skydiver   User is online

  • Code herder
  • member icon

Reputation: 7087
  • View blog
  • Posts: 24,090
  • Joined: 05-May 12

Re: Creating a customizable form at runtime

Posted 08 June 2013 - 06:47 PM

Out of curiosity, how do you handle High DPI? For example, somebody on a machine with High DPI (e.g. 120 pixel per inch) does a custom layout, and then ship that off to somebody using normal DPI (e.g. 96 pixels per inch).
Was This Post Helpful? 0
  • +
  • -

#7 firethebest   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 08-June 13

Re: Creating a customizable form at runtime

Posted 09 June 2013 - 02:21 AM

Hmm didn't think of that :/

How would you suggest I handle High DPI as I have no idea?

Thanks in advance
Was This Post Helpful? 0
  • +
  • -

#8 Skydiver   User is online

  • Code herder
  • member icon

Reputation: 7087
  • View blog
  • Posts: 24,090
  • Joined: 05-May 12

Re: Creating a customizable form at runtime

Posted 09 June 2013 - 09:35 AM

Actually, that is why I was asking how you handled it since I was fishing for ideas. In your shoes, I would keep positions and dimensions in himetric. http://en.wikipedia.org/wiki/Himetric
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1