[RESOLVED] Combo box visible property-VBForums
Results 1 to 3 of 3

Thread: [RESOLVED] Combo box visible property

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2017
    Posts
    68

    Resolved [RESOLVED] Combo box visible property

    Code:
                If MATCell2 > 0 Then
                    Combo2.Visible = True
    
                    If Combo2.Visible = True Then
                    I = I + 1
                    End If
                End If
    In design time Combo2.visible has been set to False

    When MATCells > 0 is true during run time Combobox2 is visible.

    Why the statement next

    If Combo2.Visible = True Then

    is not true ?

  2. #2
    PowerPoster
    Join Date
    Feb 2006
    Posts
    17,850

    Re: Combo box visible property

    Object (including control) properties are not always simple values.

    Assigning to them might do a number of things to cause something to happen, i.e. become visible. For that to take effect the message loop needs to gain control again to process and dispatch messages to message handlers.

    Testing them might interrogate the actual status. If the messages have not been processed yet then the status will not have changed.


    All of the code you can write in VB6 (with rare exceptions) is part of an event handler dispatched by the message loop. Until your event handler returns to its caller the message loop doesn't get control. The DoEvents() function works by making one pass through the message queue processing logic within the message loop (along with lots of other things) when called. Inserting such a call may or may not result in the updated status being reported by interrogating the property.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Sep 2017
    Posts
    68

    Re: Combo box visible property

    Thank you. Got it. Coded accordingly.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.