A little help in c#


Posted on 16th Feb 2014 07:03 pm by admin

i am doing a simple paint program using c# i want to draw with the mouse so i wrote the code of the panel events but i want to add a button and when i press the button this events happen how can i do this can i put event inside the event
here is the code
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace painter
{
public partial class painter : Form
{
bool shouldPaint = false;
public painter()
{
InitializeComponent();


}



private void painter_MouseDown(object sender, MouseEventArgs e)
{
shouldPaint = true;
}

private void painter_MouseUp(object sender, MouseEventArgs e)
{
shouldPaint = false;
}


private void painter_MouseMove(object sender, MouseEventArgs e)
{

if (shouldPaint)
{
Graphics graphics = CreateGraphics();
graphics.FillEllipse(new SolidBrush(color.black), e.X, e.Y, 10, 10);
}
}
here is the code but i want to happen when i click a button
any help thanks

No comments posted yet

Your Answer:

Login to answer
340 Like 14 Dislike
Previous forums Next forums
Other forums

echo $rows help
Hi all,

Hopefully something simple that I don't know!

I have this:

Code: [Selec

php email checker
I am having alot of trouble finding info on how to do these email things. I need to do the following

Help with PHP Email Script
Hi guys,

I'm a newbie to php and need help with the script below:

At the moment when I

Need to write a cookie with a url var
Not sure if its possible, but I need to write a cookie with a url.

So this would write 2232 a

Rand() help needed
Hi all,

Can someone explain and give me a quick example of how I would go about this?

MYSQL INSERT ID NOT WORKING
Code: $id = mysql_insert_id();
header("Location: ./?view=$id");
Why $id pulling blan

help with multi-update
Now sure how to ask this really....
10g database if that matters.

I have a customer

word wrap in emails help needed
Hello, I understand how wordwrap works in php and have used it well before. However when I used wor

Table Control
Hi Guru's,

I've created a Module pool program, which contains the Table Control.

How to use Ajax to verify data on a DB ?
Hello everyone, well i want to know how to check a value if it exists or not on a Data base and capt

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash