×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

how to create textbox/input box

how to create textbox/input box

how to create textbox/input box

(OP)
I came across this code that creates a box with 2 radio buttons on it. The user can choose which button and then pushes
an ok or cancel button. I cannot work out how to adapt it so a textbox/input box is presented so the user can type into the text box and push ok or cancel.
Is it a simple adaptaion or is it more complicated? How do I create an inputbox/textbox for the user to type in to?

thankyou
smiler 44

begin dialog userdialog1 183, 75, "choose" ' 183 = width of dialog box, 75 = height of dialog box
groupbox 5, 4, 97, 47, ""
optiongroup .optiongroup1
optionbutton 16, 12, 46, 12, "1st", .optionbutton1 '116 position from left,16 position from top, 46 width of label, 12 not sure height of label perhaps
optionbutton 16, 30, 67, 8, "2nd", .optionbbutton2
okbutton 125, 6, 54, 14
cancelbutton 125, 26, 54, 14
end dialog

dim mydialog1 as userdialog1
on error resume next
dialog mydialog1
if err=102 then
msgbox"macro ended"
end if

sasopt = mydialog1.optiongroup1
if sasopt = 0 then
msgbox "zero"
else
if sasopt = 1 then
msgbox "1"
end if
end if

RE: how to create textbox/input box

(OP)
thankyou remy998 I will try that code

smiler44

RE: how to create textbox/input box


maybe something like this would work for you?

CODE

Sub Main
    
    Default = "Hello"
    
    UserInput = InputBox ("Please Input Something",Default,Default)
    
    msgbox Ucase(UserInput)
    
End Sub 

i something use this when i don't want to use a dialog box

RE: how to create textbox/input box

(OP)
thankyou remy988. I will make a note of they way you have shown me but I have cheated. I no longer have the user input the word they want to search for into a text box but have them type it on to the "command line" at the top left of the Attachmate screen.
my code then reads it and searches.

thanks again
smiler44

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close