if statement with mousehover event
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: if statement with mousehover event

  1. #1
    Join Date
    Feb 2012
    Posts
    46

    if statement with mousehover event

    Code:
    private void solutionPanel_MouseHover(object sender, EventArgs e)
            {
                Intermediate intermediate = new Intermediate();
                DialogResult dialogues = intermediate.ShowDialog();
                if (e.Equals("solutionPanel"))
                {
                    personPanel.Visible = false;
                }
                else
                {
                    personPanel.Visible = true;
                }
    Please I want this: if I hover over solutionPanel, problemPanel should become invisible and intermediate dialog should show. everything is ok but only the if statement.

  2. #2
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,091

    Re: if statement with mousehover event

    needmuch more code than that

  3. #3
    Join Date
    Feb 2012
    Posts
    46

    Re: if statement with mousehover event

    Code:
    private void solutionPanel_MouseHover(object sender, EventArgs e)
            {
                Intermediate intermediate = new Intermediate();
                DialogResult dialogues = intermediate.ShowDialog();
    
                var btn = sender as Panel;
                if (btn != null)
                {
                    if (btn == solutionPanel)
                    {
                        problemsPanel.Enabled = false;
                        solutionPanel.Enabled=true;
                    }
                    else
                    {
                        problemsPanel.Enabled=true;
                         solutionPanel.Enabled=true;
                    }
               }
            }

    This is what I want: there are 2 panels 1 form, when I hover solutionPanel I want the problemPanel boolean state to become false, that is disabled, and solutionPanel which I set the boolean state as false to become true, that is enabled, and the dialog(intermediate to show) .
    Thanks hope I am communicating.
    Last edited by ken4ward; March 16th, 2012 at 05:31 AM.

  4. #4
    Join Date
    Feb 2011
    Location
    United States
    Posts
    1,006

    Re: if statement with mousehover event

    Er. You will need to write the code for your project. However, we can help. What happens when you hover and how does this deviate from the behavior you desire?
    Best Regards,

    BioPhysEngr
    http://blog.biophysengr.net
    --
    All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

Posting Permissions

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


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center