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

Limit user input to 1 character.


2 replies to this topic

badejo

badejo
  • Members
  • 12 posts

Posted 21 February 2002 - 16:01

The app I am installing was written to look for certain items (dll's, etc.) in a specific path off of the current drive.  Therefore I want to allow the user to choose the drive letter but have the rest of the path hard-coded.

Currently I am doing this using the AskText dialog, but it is allowing entry of multiple letters, not just one character.  I have tried limiting the string to one character in the declaration, as in:

string  svResult[2];

Stating two characters so one will hold the null string character, but the dialog still accepts alot more characters that this.  This method worked in InstallShield 5.

I realize I can always strip out the first character and do some error checking, but it would be better if I could eliminate possible user confusion.

Any ideas?


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 24 February 2002 - 22:51

Wouldn't a combo box be more suitable?

badejo

badejo
  • Members
  • 12 posts

Posted 14 March 2002 - 17:44

After some help from installshield someone finally pointed me to the GetValidDrivesList function.  I was able to use it to get a list of the drives that met my criteria, then I created  a custom dialog box with a listbox and populated it with the list obtained from the GetValidDrives function.

I think this approach is better because it keeps the user from selecting a drive that does not exist on their system.

Works with both fixed and network drives, as I call it twice, then merge the two lists together.