Connecting Tech Pros Worldwide Forums | Help | Site Map

How do I Execute the content of a textbox

Nat
Guest
 
Posts: n/a
#1: Jul 17 '05
In VB5 I have a textbox containing "cmdText1.Visible = False".

How can I execute this? IOW: How can I hide cmdText1 using the above?

Nat



Hal Rosser
Guest
 
Posts: n/a
#2: Jul 17 '05

re: How do I Execute the content of a textbox



"Nat" <n515hoop@centurytel.net> wrote in message
news:gqCdnR8_P9AczV7cRVn-ug@centurytel.net...[color=blue]
> In VB5 I have a textbox containing "cmdText1.Visible = False".
>
> How can I execute this? IOW: How can I hide cmdText1 using the above?
>
> Nat
>[/color]

Assuming the name of the text box is TextBox1...
If TextBox1.text = "cmdText1.Visible=False" then
cmdText1.Visible = False
End If

not what you were hoping for, I know...
JavaScript can execute a string as a Javascript command, but VB can't



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.818 / Virus Database: 556 - Release Date: 12/17/2004


Steve Gerrard
Guest
 
Posts: n/a
#3: Jul 17 '05

re: How do I Execute the content of a textbox



"Hal Rosser" <hmrosser@bellsouth.net> wrote in message
news:9XPwd.2695$3X5.2069@bignews3.bellsouth.net...
|
| "Nat" <n515hoop@centurytel.net> wrote in message
| news:gqCdnR8_P9AczV7cRVn-ug@centurytel.net...
| > In VB5 I have a textbox containing "cmdText1.Visible = False".
| >
| > How can I execute this? IOW: How can I hide cmdText1 using the
above?
| >
| > Nat
| >
|
|
| not what you were hoping for, I know...
| JavaScript can execute a string as a Javascript command, but VB can't
|

Actually, you can execute a string in VB, if you use the Microsoft
Script Control:

Private Sub Form_Load()
Text1.Text = "cmdText1.Visible = False"
Call ScriptControl1.AddObject(cmdText1.Name, cmdText1)
End Sub

Private Sub Command1_Click()
Call ScriptControl1.ExecuteStatement(Text1.Text)
End Sub




Nat
Guest
 
Posts: n/a
#4: Jul 17 '05

re: How do I Execute the content of a textbox


>> In VB5 I have a textbox containing "cmdText1.Visible = False".[color=blue][color=green]
>>
>> How can I execute this? IOW: How can I hide cmdText1 using the above?
>>
>> Nat
>>[/color]
>
> Assuming the name of the text box is TextBox1...
> If TextBox1.text = "cmdText1.Visible=False" then
> cmdText1.Visible = False
> End If
>
> not what you were hoping for, I know...
> JavaScript can execute a string as a Javascript command, but VB can't[/color]

Thanks for a good try, Hal.
nat


Nat
Guest
 
Posts: n/a
#5: Jul 17 '05

re: How do I Execute the content of a textbox


[color=blue][color=green]
>> In VB5 I have a textbox containing "cmdText1.Visible = False".
>>
>> How can I execute this? IOW: How can I hide cmdText1 using the
>>above?
>>
>> Nat[/color][/color]
[color=blue]
> Actually, you can execute a string in VB, if you use the Microsoft
> Script Control:
>
> Private Sub Form_Load()
> Text1.Text = "cmdText1.Visible = False"
> Call ScriptControl1.AddObject(cmdText1.Name, cmdText1)
> End Sub
>
> Private Sub Command1_Click()
> Call ScriptControl1.ExecuteStatement(Text1.Text)
> End Sub[/color]

Ah....now all I have to do is find ScriptControl. (g)
thanks, I'll give it a try.
nat


Closed Thread