Click here to Skip to main content
15,914,109 members
Home / Discussions / C#
   

C#

 
GeneralRe: USB (removable) drives in listbox Pin
MatrixCoder8-May-07 10:40
MatrixCoder8-May-07 10:40 
GeneralRe: USB (removable) drives in listbox Pin
simplicitylabs8-May-07 12:06
simplicitylabs8-May-07 12:06 
GeneralRe: USB (removable) drives in listbox Pin
simplicitylabs8-May-07 12:16
simplicitylabs8-May-07 12:16 
AnswerRe: USB (removable) drives in listbox Pin
AFSEKI8-May-07 23:11
AFSEKI8-May-07 23:11 
Questionproblem to use TreeView in show Hierarchy data. Pin
hdv2128-May-07 8:52
hdv2128-May-07 8:52 
AnswerRe: problem to use TreeView in show Hierarchy data. Pin
PIEBALDconsult8-May-07 9:51
mvePIEBALDconsult8-May-07 9:51 
AnswerRe: problem to use TreeView in show Hierarchy data. Pin
PIEBALDconsult8-May-07 11:13
mvePIEBALDconsult8-May-07 11:13 
QuestionProblems with GUI in Visual Studio C# .Net Pin
zeeShan anSari8-May-07 8:05
zeeShan anSari8-May-07 8:05 
Hi friends!
I have some problems with GUI in C#.Net ,Can anybody solve these?
First ,How can I save the image from the PictureBox to the Harddrive…. Is it wrong method or not for save the any image ? like as
//Save file
private void savebt_Click(object sender, System.EventArgs e)
{


if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
filename =saveFileDialog1.FileName;
Stream filestream =File.OpenWrite(filename);
using(StreamWriter fwriter= new StreamWriter(filestream))
{ fwriter.Write(PictureBox.Image);}
}

}

Second , I use the following codes for drawing into the pictureBox2 by Pen

private void pictureBox2_MouseDown(object sender, MouseEventArgs e)
{
Pen p = new Pen(Color.Red, 5);
g = pictureBox2.CreateGraphics();
if (e.Button == MouseButtons.Left)

{ g.DrawEllipse(p, e.X, e.Y, 5, 7); }
}
private void pictureBox2_MouseMove(object sender, MouseEventArgs e)
{
Pen p = new Pen(Color.Red, 5);
g = pictureBox2.CreateGraphics();
if (e.Button == MouseButtons.Left)

{ g.DrawEllipse(p, e.X, e.Y, 5, 7); }

}
But there is a problem when I RUN the program and start the drawing if when I move the mouse fastly then such drawing break into small ellipse,I think you have understand

Third , I use follwing codes to draw the line into the pictureBox2 :

private void pictureBox2_MouseDown(object sender, MouseEventArgs e)
{ Pen p = new Pen(Color.Red, 5);
g = pictureBox2.CreateGraphics();
g.DrawEllipse(p, e.X, e.Y, 2, 2);
mx = e.X;
my = e.Y;
}
private void pictureBox2_MouseUp(object sender, MouseEventArgs e)
{
Pen p = new Pen(Color.Red, 5);
g = pictureBox2.CreateGraphics();
g.DrawLine(p, mx, my, e.X, e.Y);
}
But I confuse for that
private void pictureBox2_MouseMove(object sender, MouseEventArgs e)
{
???????????????????????????????
}
I want when I move the mouse arrow onto the pictureBox2 ,then the line move with respect to the mouse and not draw untill UP the mouse button.

I am waiting for your kindly response

Thanks
D'Oh! | :doh:
AnswerRe: Problems with GUI in Visual Studio C# .Net Pin
Luc Pattyn8-May-07 8:25
sitebuilderLuc Pattyn8-May-07 8:25 
GeneralRe: Problems with GUI in Visual Studio C# .Net Pin
zeeShan anSari9-May-07 9:54
zeeShan anSari9-May-07 9:54 
QuestionRedrawing Screen Pin
rahvyn68-May-07 7:45
rahvyn68-May-07 7:45 
QuestionScanning all files in a computer Pin
sharpiesharpie8-May-07 7:09
sharpiesharpie8-May-07 7:09 
AnswerRe: Scanning all files in a computer Pin
Dave Kreskowiak8-May-07 7:34
mveDave Kreskowiak8-May-07 7:34 
GeneralRe: Scanning all files in a computer Pin
sharpiesharpie8-May-07 11:27
sharpiesharpie8-May-07 11:27 
GeneralRe: Scanning all files in a computer Pin
Luc Pattyn8-May-07 12:16
sitebuilderLuc Pattyn8-May-07 12:16 
GeneralRe: Scanning all files in a computer Pin
Dave Kreskowiak8-May-07 17:29
mveDave Kreskowiak8-May-07 17:29 
QuestionHow to determine primary columns in a table Pin
Naveed Kamboh8-May-07 6:32
Naveed Kamboh8-May-07 6:32 
AnswerRe: How to determine primary columns in a table Pin
Giorgi Dalakishvili8-May-07 7:15
mentorGiorgi Dalakishvili8-May-07 7:15 
QuestionUnable to use decimal in "if" statement. Pin
Goalie358-May-07 5:43
Goalie358-May-07 5:43 
AnswerRe: Unable to use decimal in "if" statement. Pin
ccitt8-May-07 5:47
ccitt8-May-07 5:47 
AnswerRe: Unable to use decimal in "if" statement. Pin
Guffa8-May-07 5:55
Guffa8-May-07 5:55 
Questionloop dictionary Pin
arkiboys8-May-07 5:39
arkiboys8-May-07 5:39 
AnswerRe: loop dictionary Pin
Judah Gabriel Himango8-May-07 5:57
sponsorJudah Gabriel Himango8-May-07 5:57 
AnswerRe: loop dictionary Pin
Martin#8-May-07 6:06
Martin#8-May-07 6:06 
QuestionCreating a Windows Service account... Pin
ccitt8-May-07 5:19
ccitt8-May-07 5:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.