dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Newbie: "For Each with variable" Question

  1. #1
    dnagel Guest

    Re: Newbie: "For Each with variable" Question

    > If TypeOf vControl Is Obj_Ctrl Then

    if typeof vcontrol is combobox then

    or

    if typename(vcontrol) = "ComboBox"

    Can't see why you're passing in a variable
    for control...???

    also,
    x As String
    should read
    x As Boolean

    D.



    "Magic" <magic1521@hotmail.com> wrote in message news:3ccea9a5$1@10.1.10.29...
    |
    | Is there a way to use the following For Each with a variable?
    | IOW, ( See_Controls "CommandButton", True ),
    | to see all command buttons and ( See_Controls "CommandButton", False ),
    | To make all copmmand buttons invisiable?
    |
    | This does not work!
    | I've tried every combination I could think of!
    |
    | Private Sub See_All_Controls(Obj_Ctrl As Control, x As String)
    |
    | Dim vControl
    |
    | ' make Controls on form visible/invisible.
    | For Each vControl In Me.Controls ' where Me is the form
    | If TypeOf vControl Is Obj_Ctrl Then
    | vControl.Visible = x
    | End If
    | Next
    |
    | End Sub
    |
    | Thanks,
    |
    | Magic



  2. #2
    Magic Guest

    Newbie: "For Each with variable" Question


    Is there a way to use the following For Each with a variable?
    IOW, ( See_Controls "CommandButton", True ),
    to see all command buttons and ( See_Controls "CommandButton", False ),
    To make all copmmand buttons invisiable?

    This does not work!
    I've tried every combination I could think of!

    Private Sub See_All_Controls(Obj_Ctrl As Control, x As String)

    Dim vControl

    ' make Controls on form visible/invisible.
    For Each vControl In Me.Controls ' where Me is the form
    If TypeOf vControl Is Obj_Ctrl Then
    vControl.Visible = x
    End If
    Next

    End Sub

    Thanks,

    Magic

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center