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

Word Trimming
Hi Guys & Gals!!

Hope you are all ok....

I need some help with the following

PHP, jAVASCRIPT setting input values, why isn't it working?
Hi:

I am calling this javascript:
<script language="javascript">

problem in program for counting no of chars using pointers
Hi all, I was trying to make a program which counts number of chars in a string using concpt of poin

Stopped working!
So I had to change some stuff, none of it major. Stuff like the extension_dir and such. BEFORE I did

please help me... my password gets encrypted but not able to get in database
hai guys,
please help me... in the following function my password gets encrypted but no

Program with calculate Meteorologic measurements
Hello I'm a beginner and I want to make a program with calculate Meteorologic measurements:
ba

setcookie and isset($_COOKIE(name)) seem very finnicky.
I'm currently playing around with a user system with login and registration. I'm trying to use cooki

extending tidy
I have problem with type-hinting and extending tidy. This code creates error:
Code: class cMyTidy

PHP Captcha Error help - replace the "die" command
Hi All,

I am after a bit of help with a Captcha spam protection box.

The site gave me

Suggestions for Functional module
Hello experts,
I Have done B.Sc(Mathematics) and MCA & have learnt SAP/ABAP but do n

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