Jump to content

How to force inputbox not to be left empty?


igorm
 Share

Recommended Posts

Hi.

I need a little help. I created one small application with few inputboxes, but I need to force user to enter the path to the folder (not to file). It would be good if I could display message to user if he/she did not enter the path. Can somebody help me with this please?

Tnx in advance for help.

Cheers :)

The solution you require for this is probably tooltips the following is an example:

$ExitButton = GUICtrlCreateIcon("shell32.dll", 240, 450, 240, 40, 35)

GUICtrlSetTip(-1, " Exit", "Help", 1, 1)

In this example the reference to shell32.dll,240 determines what the control look like in the case a fancy X. The control itself can be an inputbox or a button or any of the other types. When the mouse pointer floats over the control then the tip is displayed in a message box. In the case the message is "Exit" it can be whatever you would like it to be you can use @crlf or @ lf to start text on new lines in the box this is an example

GUICtrlSetTip(-1, " Exit" & @crlf & @lf & "This is the additional message", "Help", 1, 1)

The input error trap would be accommodated in the control routine

$inputbox1 = GUICtrlRead($nameforinputbox) ;read the input

While 1

$msg = GUIGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE Or $msg = $ExitButton

GUIDelete()

Exit

Case $msg = "nameofyourinputbox"

"perform the input test based on if and or then"

Endselect

Wend

Hope that this gets you going

Cheers

Ant..

Edited by anixon
Link to comment
Share on other sites

Thank you for help, but it is not what I need. It seems that I did not explain quite well.

I have two inputboxes. One is for folder browsing (I used FileSelectFolder).

Second one is for selecting files (I used FileOpenDialog)

And I have one button which will execute something. But execution will fail if first inputbox is empty. So when user press button for execute and first inputbox is empty I need to display message that path is not entered and to stop execution activated by pressing button.

Hope you can help me now.

Thanks again.

Cheers :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...