|
-
Aug 3rd, 2008, 01:38 AM
#1
Thread Starter
Member
help with msgbox and text1
have made it before, but cant remeber the code. I want it so that when
anything is written in text1 it = "Hello (Name)"
get what i mean?
if not, i want it so that when anything is written in text one, and i hit the command button it says "hello (entered name)"
-
Aug 3rd, 2008, 01:41 AM
#2
Re: help with msgbox and text1
In the command button's Click try,
MsgBox "Hello " & Text1.Text
-
Aug 3rd, 2008, 01:46 AM
#3
Thread Starter
Member
Re: help with msgbox and text1
that worked, but i want to make so that if it isnt blank the message gets displayed, basically:
If Text1 = "" Then
MsgBox "You must enter your name"
End If
MsgBox "Hello " & Text1.Text
is what i have so far (thanks to you =p) but i need it to make it so that it cant be blank i thought it was
elseif text1 = <> "" & text1.text
but im not sure..
-
Aug 3rd, 2008, 02:28 AM
#4
Re: help with msgbox and text1
 Originally Posted by Badboyjt432
that worked, but i want to make so that if it isnt blank the message gets displayed, basically:
If Text1 = "" Then
MsgBox "You must enter your name"
End If
MsgBox "Hello " & Text1.Text
is what i have so far (thanks to you =p) but i need it to make it so that it cant be blank i thought it was
elseif text1 = <> "" & text1.text
but im not sure..
Well if you don't want to continue if no name was entered the why not just exit the button_click sub?
If Text1.Text = "" Then
MsgBox "You must enter your name"
Exit Sub
End If
MsgBox "Hello " & Text1.Text
-
Aug 3rd, 2008, 02:38 AM
#5
Thread Starter
Member
Re: help with msgbox and text1
THANK YOU! thats what i wanted!
-
Aug 3rd, 2008, 02:50 AM
#6
Thread Starter
Member
Re: help with msgbox and text1
i need more help..well for starters all my .frm's when i try to open them, nothing shows up, no error, no code, no anything.. Next, my audio player that i made is saying that:
If Combo1 = "The Misfits - Saturday Night" Then
MsgBox "Copyrighted By: Taylor (aka PhReAkInGjt or Jtst1"
End If
If Combo1 = "The Misfits - Saturday Night" Then
Call Playwave("The Misfits - Saturday Night.WAV", 1)
End If
Call cannot be defined? I have a working version of this, but i dont know what to do.
-
Aug 3rd, 2008, 10:33 AM
#7
Re: help with msgbox and text1
I don't understand this. Is "call cannot be defined" error that you get? On what line?
Why are you trying to hard code this anyways?
-
Aug 3rd, 2008, 11:05 AM
#8
Hyperactive Member
Re: help with msgbox and text1
Also the code
Code:
If Combo1 = "The Misfits - Saturday Night" Then
is very ambiguous, do you mean to say
Code:
If Combo1.Text = "The Misfits - Saturday Night" Then
-
Aug 3rd, 2008, 11:10 AM
#9
Re: help with msgbox and text1
@Ione REBEL: you're true but his version is still correct. You don't need to specify Control's Property if it's default. For example:
Code:
Picture1 = LoadPicture("c:\windows\gone fishing.bmp") 'instead of Picture1.Picture = ...
... will work, since .Picture is PictureBox's default Property.
I'm also against this syntax but it's correct
-
Aug 3rd, 2008, 11:19 AM
#10
Hyperactive Member
Re: help with msgbox and text1
LOL, thats true.
I also said it was AMBIGUOUS, not that it won't work. I used to do that too, when I was a newbie ROFL. I was just pointing out that it was not a very good programming practice. I also consider the code given by EdgeMeal:
Code:
If Text1.Text = "" Then
MsgBox "You must enter your name"
Exit Sub
End If
MsgBox "Hello " & Text1.Text
to be not a very good programming practice since it is making things complex. I would rather use:
Code:
If Text1.Text = "" Then
MsgBox "You must enter your name"
Else
MsgBox "Hello " & Text1.Text
End If
Does that not work exactly like the former code? And its much simpler and easier to understand.
-
Aug 3rd, 2008, 11:22 AM
#11
Re: help with msgbox and text1
OK, it was a miss-understanding
-
Aug 3rd, 2008, 11:28 AM
#12
Re: help with msgbox and text1
 Originally Posted by Badboyjt432
i need more help..well for starters all my .frm's when i try to open them, nothing shows up, no error, no code, no anything.. Next, my audio player that i made is saying that:
If Combo1 = "The Misfits - Saturday Night" Then
MsgBox "Copyrighted By: Taylor (aka PhReAkInGjt or Jtst1"
End If
If Combo1 = "The Misfits - Saturday Night" Then
Call Playwave("The Misfits - Saturday Night.WAV", 1)
End If
Call cannot be defined? I have a working version of this, but i dont know what to do.
What does the Playwave procedure look like?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|