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

onClick='location.href=index.htm'> not working
Below is my code:

echo "<input type='button' value='redirect' onClick='location.h

Change image filetype on upload?
Hi,
I've got a form which uploads an image to the server.
Is it possible to change the image t

help need on ob_start()
Hi

I am a newbie in php, I have a code
Line number On/Off | Expand/Contract <?phpo

Good Programming and Web Design Books
Hi,

I recived a pm today from a fellow phpfreaker regarding php books, i replied with the fo

Post PHP form to non-existing page
The company that I work for host their PHP code on IIS on a Windows server, no Apache, so no mod_rew

random generation
hi

i need help with generating this

numbers from 1-12

i want to generate in ran

Search in the PHP Files
have to search asterisk(*) in the php code of the php files .
In the html page one text box

Preg_match unknown modifyer
Hello,

Im trying to write a little script for my forums i need to get the reply from my forum

Creation of Raw Exposure manually
SAP Gurus

I am creating Raw Exposure ( Hedge management ) thru T Code TEM10 with followin

Undefined Index Notice In Internet Explorer Only
I am getting the following notice:

QuoteNotice: Undefined index: jrox in /home/ycsn/public_h

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