|
-
September 4th, 2011, 05:12 PM
#1
Need a little help with some C# code.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Mouse_Shaker
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void panel1_MouseEnter(object sender, EventArgs e)
{
//Changes Background color of main panel to blue.
panel3.BackColor = Color.Blue;
}
private void panel2_MouseEnter(object sender, EventArgs e)
{
//Changes Background color of main panel to red.
panel3.BackColor = Color.Red;
}
private void panel1_Paint(object sender, EventArgs e) {
}
}
}
so if you couldn't tell from the code, I am trying to get it so that when the mouse enters panel1, panel3 (the main panel) turns blue, and when I enter panel2, panel 3 turns red.
The only problem is that when I run the program, when the mouse enters panel 1 the background turns blue, but when it enters panel 2, nothing happens, and it doesn't matter if it enters panel 2 first or second, it just won't happen. How do I fix this?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|