5 Replies - 3434 Views - Last Post: 08 August 2010 - 01:24 PM Rate Topic: -----

#1 Snakeruler  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 34
  • Joined: 09-April 10

Mouse hover and enter

Posted 08 August 2010 - 07:09 AM

I've googled these and I can't find anything that works, everything I try doesn't work. I need something to happen when I press enter while on my richtextbox, and Mouse hover, Mouse leave and Mouse click help. I can't convert them to buttons, so I'm keeping them as picture boxes.
Is This A Good Question/Topic? 0
  • +

Replies To: Mouse hover and enter

#2 Momerath  Icon User is online

  • D.I.C Lover
  • member icon

Reputation: 809
  • View blog
  • Posts: 1,949
  • Joined: 04-October 09

Re: Mouse hover and enter

Posted 08 August 2010 - 08:22 AM

View PostSnakeruler, on 08 August 2010 - 05:09 AM, said:

I've googled these and I can't find anything that works, everything I try doesn't work. I need something to happen when I press enter while on my richtextbox, and Mouse hover, Mouse leave and Mouse click help. I can't convert them to buttons, so I'm keeping them as picture boxes.

What does a picture box have to do with Mouse events on a richtextbox? Show the code you have tried, as these are very simply done in the designer with a double click on the event.
Was This Post Helpful? 0
  • +
  • -

#3 Snakeruler  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 34
  • Joined: 09-April 10

Re: Mouse hover and enter

Posted 08 August 2010 - 08:27 AM

It's two different questions hehe.

I haven't got the code currently, but basically what it is, is I set up a void (pictureBox1 hover one) and nothing get's done in side the void.

And the other rich text box part, basically when the person presses enter while it'sgot the rich text box selected, it adds "\n" to the text box
Was This Post Helpful? 0
  • +
  • -

#4 Bacanze  Icon User is offline

  • D.I.C Head

Reputation: 35
  • View blog
  • Posts: 202
  • Joined: 09-April 10

Re: Mouse hover and enter

Posted 08 August 2010 - 11:14 AM

View PostSnakeruler, on 08 August 2010 - 06:09 AM, said:

I need something to happen when I press enter while on my richtextbox


Your question is confusing so first I'll answer this part

  private void richTextBox1_KeyPress(object sender, KeyPressEventArgs e)
        {
            if(e.KeyChar == (char)Keys.Enter)
            {
                //Do whatever
            }
        }



Edit: didn't see the post above for some reason, can you explain this a little more:

View PostSnakeruler, on 08 August 2010 - 07:27 AM, said:

I haven't got the code currently, but basically what it is, is I set up a void (pictureBox1 hover one) and nothing get's done in side the void.

This post has been edited by Bacanze: 08 August 2010 - 11:16 AM

Was This Post Helpful? 0
  • +
  • -

#5 Snakeruler  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 34
  • Joined: 09-April 10

Re: Mouse hover and enter

Posted 08 August 2010 - 11:22 AM

Basically, what I want it to do, is when I hover over an Image, it chsanges to another image, and when I leave it, it changes back. Also when I click it it does that.
Was This Post Helpful? 0
  • +
  • -

#6 Sergio Tapia  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1211
  • View blog
  • Posts: 4,126
  • Joined: 27-January 10

Re: Mouse hover and enter

Posted 08 August 2010 - 01:24 PM

You want to access the MouseEnter and MouseLeave event methods from within the Properties tab when your pictureBox is selected in Visual Studio.

Posted Image
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1