Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Read a text from a textboxes


5 replies to this topic

SteM

SteM
  • Full Members
  • 3 posts

Posted 22 December 2008 - 18:42

Hi all,
i'm writing a vb.net 2003 app and relative setup.
In the setup project i need a user's input so I inserted a standard textboxes dialog.
Now I need to write the textbox content in a new text file or in a registry key.

How can i do it?
How can i read the text from the textbox?

Thanks !

VBScab

VBScab
  • Full Members
  • 436 posts

Posted 23 December 2008 - 09:52

Each control should have a property assigned to it. I'd recommend using a public property i.e. in all upper-case). Your text file/registry key can read the contents from the property.
- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.

SteM

SteM
  • Full Members
  • 3 posts

Posted 23 December 2008 - 11:22

Thanks.
Yes, the textbox has the EDITA1 as property but I don't know how to handle it.
Do I nedd external code?
Or Can I access to the property from the IDE and write a file/registry?
How can i handle the property ??

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 23 December 2008 - 11:31

Properties are like variables in other programming languages.
For instance you could create a registry entry with value:
[EDITA1]
Enclosing the property name in square brackets will replace it with the property's value (the content of your text box) at runtime.

VBScab

VBScab
  • Full Members
  • 436 posts

Posted 23 December 2008 - 11:34

Just refer to the property in the registry entry in the normal way. For example, let's say your edit box was for an FTP server name, and the user would enter 'ftp.ourdomain.com'. Thus, where the Registry table entry would be something like this (the commas are to delineate the table columns and shouldn't be entered):

Registry,2,Software\VendorName\ApplicationName,FTPHostName,ftp.ourdomain.com,FTPHostName

you would edit to to read like this:

Registry,2,Software\VendorName\ApplicationName,FTPHostName,[EDITA1],FTPHostName

BTW, I'd change that property name to something meaningful. That's not compulsory, of course, but I have a pathological hatred of meaningless property names (and variable names in scripts/programs/batch files...)

Edited by VBScab, 23 December 2008 - 11:34.

- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.

SteM

SteM
  • Full Members
  • 3 posts

Posted 29 December 2008 - 10:57

Thanks a lot,
I simply added a new string value on the registry, giving it the name of the property.

VBScab: don't worry, i used a meaningful name wink.gif

BTW: can i show a MessageBox right after the pression of the Next button? Just to say 'Ok the code is correct' or 'Code unknown' ?

Thanks again !