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

ECC6 - Single sign-on
We are in the process of upgrading to ECC 6 which will support single sign on with user passwords al

upgrade from 4.7 to ECC 6.0
Hi all,
we are going to do an upgrade from R/3 4.7 to ECC 6.0. I need to know if i can find som

Display data returned from Ajaxservices!!
I have a question about displaying results using ajax. I have part of the code below.
$.ajax({

MASS PM
Hello all, I'm trying to send mass private messages to users in my database but keep getting an erro

$_POST
Hi, I have 2 seperate php files, and i want my $_POSt["fname"] To go into both of them, Fo

Insert data in Mysql and move to another page
I'm stuck with this simple problem. I need to insert data in Mysql and then hit submit and move to a

Help with email validation please...
Hi,
Please could you help.
I have a register.php login page where users register, the detail

small inaccuracies
I have this code to convert fractional base 10 into base 2:

while($num > 0)

Loop Through Date Range
Hi guys,
I have date range as parameter like 01/JAN/2009 TO 16/JAN/2009 now i want to loop thro

PHP Game
hy i was wondering what's the best method in order to make some automatic updates in a php game
<

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