Click here to Skip to main content
15,898,134 members
Home / Discussions / C#
   

C#

 
AnswerRe: custom controls-query Pin
freshonlineMax21-Dec-05 22:19
freshonlineMax21-Dec-05 22:19 
QuestionGraphics+Line vanishes when another line is drawn Pin
Mahi.Ragava21-Dec-05 17:40
Mahi.Ragava21-Dec-05 17:40 
AnswerRe: Graphics+Line vanishes when another line is drawn Pin
Christian Graus21-Dec-05 19:14
protectorChristian Graus21-Dec-05 19:14 
GeneralRe: Graphics+Line vanishes when another line is drawn Pin
Mahi.Ragava21-Dec-05 19:47
Mahi.Ragava21-Dec-05 19:47 
GeneralRe: Graphics+Line vanishes when another line is drawn Pin
microsoc21-Dec-05 20:05
microsoc21-Dec-05 20:05 
GeneralRe: Graphics+Line vanishes when another line is drawn Pin
Mahi.Ragava21-Dec-05 20:17
Mahi.Ragava21-Dec-05 20:17 
GeneralRe: Graphics+Line vanishes when another line is drawn Pin
Christian Graus22-Dec-05 9:30
protectorChristian Graus22-Dec-05 9:30 
QuestionScreen Flickers When I Move Mouse Pin
...---...21-Dec-05 15:56
...---...21-Dec-05 15:56 
Hi,
I am writing some code (for fun) that will display the mouse coordinates in real time on a WinForm. The "e.X, e.Y" coordinate text is displayed next to the position of the cursor. Problem is, every time I move the mouse the graph that I've drawn to "run" the coordinates over
keeps getting re-drawn (flicker?) until I stop moving the mouse-- and then the coordinates are displayed over the graph I've drawn. Is there any way to fix this?
ps- many people have very helpful to my questions --> I am very grateful.

////////////////////////////////////////////////////////////
Here are the relevant code fragments....1)Paint, 2)MouseMove, 3)override OnPaint
///////////////////////////////////////////////////////////
void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
Graphics g = e.Graphics;
g.DrawRectangle(graphPen, xIndent, yIndent, 400,400);
g.FillRectangle(graphBrush, xIndent, yIndent, 400, 400);
g.DrawLine(graphPen, xIndent + 200, yIndent, xIndent + 200, yIndent + 400);
g.DrawLine(graphPen, xIndent, yIndent + 200, xIndent + 400, yIndent + 200);
DrawGraphLines(g);
DrawXYAxes(g);
if(m_bFlag1)
DrawComplexLineA(g);
if(m_bFlag2)
DrawComplexLineB(g);
if(m_bAddFlag)
DrawComplexAdd(g);
}

///////////////////////////////////////////////////////////////////////////

private Point mousePoints;

protected override void OnMouseMove(MouseEventArgs e)
{
// TODO: Add Form1.OnMouseMove implementation
mousePoints = new Point(e.X,e.Y);
Invalidate();

base.OnMouseMove (e);
}
////////////////////////////////////////////////////////////////////////////

protected override void OnPaint(PaintEventArgs e)
{
// TODO: Add Form1.OnPaint implementation
base.OnPaint (e);
Point screen = PointToScreen(mousePoints);
string location = screen.ToString();
e.Graphics.DrawString("[Screen: " + location + "]",
new Font("Arial",8),
SystemBrushes.ControlText,
(PointF)mousePoints);

}
/////////////////////////////////////////////////////////

AnswerRe: Screen Flickers When I Move Mouse Pin
Christian Graus21-Dec-05 16:38
protectorChristian Graus21-Dec-05 16:38 
GeneralRe: Screen Flickers When I Move Mouse Pin
...---...21-Dec-05 17:35
...---...21-Dec-05 17:35 
GeneralRe: Screen Flickers When I Move Mouse Pin
microsoc21-Dec-05 18:33
microsoc21-Dec-05 18:33 
GeneralRe: Screen Flickers When I Move Mouse Pin
Christian Graus21-Dec-05 19:13
protectorChristian Graus21-Dec-05 19:13 
QuestionWhat Port Class of CF in .Net Framework? Pin
denpsia21-Dec-05 13:31
denpsia21-Dec-05 13:31 
QuestionAproximate string matching Pin
Elvio Fernandez21-Dec-05 12:46
Elvio Fernandez21-Dec-05 12:46 
AnswerRe: Aproximate string matching Pin
Curtis Schlak.22-Dec-05 2:44
Curtis Schlak.22-Dec-05 2:44 
GeneralRe: Aproximate string matching Pin
Elvio Fernandez23-Dec-05 10:37
Elvio Fernandez23-Dec-05 10:37 
GeneralRe: Aproximate string matching Pin
Curtis Schlak.24-Dec-05 9:37
Curtis Schlak.24-Dec-05 9:37 
GeneralRe: Aproximate string matching Pin
Curtis Schlak.27-Dec-05 8:28
Curtis Schlak.27-Dec-05 8:28 
GeneralRe: Aproximate string matching Pin
Elvio Fernandez28-Dec-05 8:43
Elvio Fernandez28-Dec-05 8:43 
GeneralRe: Aproximate string matching Pin
Curtis Schlak.28-Dec-05 12:02
Curtis Schlak.28-Dec-05 12:02 
QuestionPath to default files called by program Pin
smurfy3421-Dec-05 11:14
smurfy3421-Dec-05 11:14 
AnswerRe: Path to default files called by program Pin
rakesh_nits21-Dec-05 18:39
rakesh_nits21-Dec-05 18:39 
QuestionConnect to a password protected database Pin
kornstyle21-Dec-05 10:59
kornstyle21-Dec-05 10:59 
AnswerRe: Connect to a password protected database Pin
Guffa21-Dec-05 12:29
Guffa21-Dec-05 12:29 
GeneralRe: Connect to a password protected database Pin
kornstyle22-Dec-05 2:45
kornstyle22-Dec-05 2:45 

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.