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

PHP using IF to display error
i have a MySQL query and i want to display 1 thing only if the number of affected rows is >=1

MySQL query problem
When I try to run the following piece of code, I get this error:
QuoteWarning: mysql_query(): sup

[RESOLVED] Socket/Port remains open after app crashes
I'm having this problem with a networked app in vb.net.

If the program exits normally the por

Pro-rata Billing in Periodic Billing for Rental
Hi guys,

We have a situation, where a rental contract starts at the mid of the month say

How to change www in url with a specified name
Hi
I'm trying to change the url http://www.sitename.com/apparels to something like below
http:

Passing JS to PHP
So I have the following
Code: <?php
getdetails(?><script type="text/

Add_Months not Easy to Understand
Oracle is number 1, very fast and very easy. But....
OK, I think but have a problem, only 1 pro

Include ("Absolute Path") of a file?
I'm not sure what I'm doing wrong. I am writing my php code in the same directory of the file that

$variable = $variable
Hello

Sorry if this is a really simple question but I have run out of ideas. Is there a reall

Using insert variable
need a way to inert variable data to mysql database

$acc = "212121212";
$nok =

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