I’m new to Visual Studio using C#. I have created a sample Winforms project on .NET 8 called Test1
:
<code>namespace Test1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
pictureBox1.BackColor = Color.Red;
}
}
}
</code>
<code>namespace Test1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
pictureBox1.BackColor = Color.Red;
}
}
}
</code>
namespace Test1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
pictureBox1.BackColor = Color.Red;
}
}
}
I have placed 2 controls on the Form1
; button1
and pictureBox1
.
So I double clicked button1 and received
<code>private void button1_Click(object sender, EventArgs e)
</code>
<code>private void button1_Click(object sender, EventArgs e)
</code>
private void button1_Click(object sender, EventArgs e)
in my code.
I was able to set pictureBox1.BackColor
to Red. I’m not able to generate –
<code>private void _ pictureBox1_Paint(object sender, EventArgs e)
</code>
<code>private void _ pictureBox1_Paint(object sender, EventArgs e)
</code>
private void _ pictureBox1_Paint(object sender, EventArgs e)
How do I do that? I feel helpless as a newbie. ☹
2