Select Controls from Form

Anything VBScript-related, including Windows Script Host, WMI, ADSI, and more.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
InSiDeR
Posts: 6
Joined: Wed Jan 25, 2012 7:44 pm

Select Controls from Form

Post by InSiDeR » Wed Jan 25, 2012 7:48 pm

Hello everybody,I am an absolulety newbie in vbscripting. I have a form and there are several control on that form.Now I want a loop to run thorugh all controls on that form. For each control I want to ask, what type of control is that, like a Textbox, Label and so on... My VB Code:For Each ctl As Control in Antrag_1 If Dim ctl TypeOf(ctl) Is Textbox Then If ctl.Value <> "" Then TabControl.Pages(0) = "(*) Sammelumzug" End If End If Next VBScript cannot do anything with "As" or "TypeOf". Can someone please help me with that problem? Thanks a lot. Greetings

User avatar
InSiDeR
Posts: 6
Joined: Wed Jan 25, 2012 7:44 pm

Select Controls from Form

Post by InSiDeR » Thu Jan 26, 2012 6:01 am

I know that this is VB.I need such code in VBScript. We worked with a support ticket system and there are several forms. This ticket system works with VBScript.

User avatar
InSiDeR
Posts: 6
Joined: Wed Jan 25, 2012 7:44 pm

Select Controls from Form

Post by InSiDeR » Thu Jan 26, 2012 6:39 am

My ticket system uses forms in another way. No windows forms! It has own controls like textboxes, checkboxes etc. And this ticket system uses VBScript!

User avatar
InSiDeR
Posts: 6
Joined: Wed Jan 25, 2012 7:44 pm

Select Controls from Form

Post by InSiDeR » Thu Jan 26, 2012 5:05 pm

I have already post the existing code in my 1st posting.
And I know that this is VB and NOT VBScript.InSiDeR2012-01-27 00:17:32

User avatar
InSiDeR
Posts: 6
Joined: Wed Jan 25, 2012 7:44 pm

Select Controls from Form

Post by InSiDeR » Thu Jan 26, 2012 6:34 pm

No the system isnt running with VB and I know that this Code is VB. That is an example in VB which must be modified for VBScript.

User avatar
InSiDeR
Posts: 6
Joined: Wed Jan 25, 2012 7:44 pm

Select Controls from Form

Post by InSiDeR » Thu Feb 16, 2012 7:28 pm

Its done. I completed my work correctly and now its fine dynamically :) And my VBScript can access to my wonderful Windows.Forms. IT IS POSSIBLE TO TO !!!

Locked