Results 1 to 2 of 2

Thread: WindowState/ Show in Task bar

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 1999
    Location
    Glasgow,Scotland
    Posts
    281

    Post


    I have two forms - form1 and form2. Form1 has a command button. When clicked, form2
    will minimize to the taskbar, or else it's Window state will be normal - it depends on its current position. The colour of the command button will become white or grey, also depending on the window state of form2.

    i.e:

    Private Sub Command1_Click()
    If Form2.WindowState = vbNormal Then
    Form2.WindowState = vbMinimized
    Form1.Command1.BackColor = &H8000000F
    Else
    If Form2.WindowState = vbMinimized Then
    Form2.WindowState = vbNormal
    Form1.Command1.BackColor = vbWhite
    End If
    End If
    End Sub

    The above works fine - form2 minimizes/ normalizes and the command button turns grey/
    white, respectively. The problem is when someone clicks on form2 when it has been
    minimized to the Taskbar - I mean if they click the icon on the taskbar (to where the form has been minimized) instead of the command button. Form2 goes to its correct window state, but the command button on Form1 stays grey, when it is supposed to go white.

    Is there any way I can have it so that the command button will turn grey when form2 is
    minimized, and white when it is maximized - regardless of whether they click the
    command button or not?

    Any help would be much appreciated.

  2. #2
    So Unbanned DiGiTaIErRoR's Avatar
    Join Date
    Apr 1999
    Location
    /dev/null
    Posts
    4,111

    Post

    you'll need to make code in form2's activate event

    ------------------
    DiGiTaIErRoR

Posting Permissions

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



Click Here to Expand Forum to Full Width