Click here to Skip to main content
16,015,531 members
Home / Discussions / C#
   

C#

 
GeneralRe: Unable to Call MDI Parent property from MID Client Pin
Muhammad Nauman Yousuf14-Sep-08 20:32
Muhammad Nauman Yousuf14-Sep-08 20:32 
GeneralRe: Unable to Call MDI Parent property from MID Client Pin
DaveyM6914-Sep-08 22:35
professionalDaveyM6914-Sep-08 22:35 
GeneralRe: Unable to Call MDI Parent property from MID Client Pin
Mbah Dhaim15-Sep-08 6:58
Mbah Dhaim15-Sep-08 6:58 
QuestionSearching Between Dates Pin
Vimalsoft(Pty) Ltd14-Sep-08 6:11
professionalVimalsoft(Pty) Ltd14-Sep-08 6:11 
AnswerRe: Searching Between Dates Pin
Mbah Dhaim14-Sep-08 7:00
Mbah Dhaim14-Sep-08 7:00 
QuestionGDI problem, Drawing rectangle by drag and drop. Pin
hdv21214-Sep-08 2:37
hdv21214-Sep-08 2:37 
AnswerRe: GDI problem, Drawing rectangle by drag and drop. Pin
Mbah Dhaim14-Sep-08 4:56
Mbah Dhaim14-Sep-08 4:56 
AnswerRe: GDI problem, Drawing rectangle by drag and drop. Pin
Anthony Mushrow14-Sep-08 5:03
professionalAnthony Mushrow14-Sep-08 5:03 
Ok, first - don't draw using CreateGraphics. Override the OnPaint method, or register for the OnPaint Event.
Second, you can set double buffering on your form, which should reduce filcker (There should be a property on your form for this)

And the reason there is no rectangle when you've finished.. well, its because your no longer drawing any rectangle.

Rectangle rect = new Rectangle(0,0,0,0);
OnMouseDown(...)
{
  this.dragging = true;
  rect.X = e.X;
  rect.Y = e.Y;
}

OnMouseUp(...)
{
  this.dragging = false;
}

OnMouseMove(...)
{
  if(this.dragging)
  {
    int width = e.X - this.rect.X;
    int height = e.Y - this.rect.Y;
    rect.Width = width;
    rect.Height = height;
    this.Invalidate();
  }
}

OnPaint(...)
{
  e.Graphics.DrawRectangle(myPen, rect);
}


Or something like that. You have to store the rectangle your creating, so that it can be drawn later on. It won't just stay there.

My current favourite word is: Nipple!
-SK Genius

Game Programming articles start -here[^]-

Question? operator wuestion Pin
Mohammad Dayyan14-Sep-08 1:57
Mohammad Dayyan14-Sep-08 1:57 
AnswerRe: ? operator wuestion [modified] Pin
Perspx14-Sep-08 2:12
Perspx14-Sep-08 2:12 
GeneralRe: ? operator wuestion Pin
Lutosław14-Sep-08 2:56
Lutosław14-Sep-08 2:56 
GeneralRe: ? operator wuestion Pin
Guffa14-Sep-08 3:43
Guffa14-Sep-08 3:43 
GeneralRe: ? operator wuestion Pin
Perspx14-Sep-08 3:48
Perspx14-Sep-08 3:48 
QuestionUsing the office 2007 Ribbon ( drag-n-drop a window without using the border ) [modified] Pin
Mahhouraaaaaa14-Sep-08 1:22
Mahhouraaaaaa14-Sep-08 1:22 
AnswerRe: Using the office 2007 Ribbon ( drag-n-drop a window without using the border ) Pin
The Cake of Deceit14-Sep-08 9:37
The Cake of Deceit14-Sep-08 9:37 
QuestionDebugging External .exe Pin
Jammer14-Sep-08 1:03
Jammer14-Sep-08 1:03 
AnswerRe: Debugging External .exe Pin
Jimmanuel14-Sep-08 9:18
Jimmanuel14-Sep-08 9:18 
QuestionWhat am I doing wrong with this OnPaint override? Pin
Dewald14-Sep-08 0:17
Dewald14-Sep-08 0:17 
AnswerRe: What am I doing wrong with this OnPaint override? Pin
Anthony Mushrow14-Sep-08 0:57
professionalAnthony Mushrow14-Sep-08 0:57 
GeneralRe: What am I doing wrong with this OnPaint override? Pin
Dewald14-Sep-08 2:08
Dewald14-Sep-08 2:08 
QuestionRe: What am I doing wrong with this OnPaint override? [modified] Pin
Dewald14-Sep-08 3:59
Dewald14-Sep-08 3:59 
Questionhow can i send data to database without repetition Pin
ahmedhassan9613-Sep-08 23:23
ahmedhassan9613-Sep-08 23:23 
AnswerRe: how can i send data to database without repetition Pin
User 665813-Sep-08 23:55
User 665813-Sep-08 23:55 
AnswerRe: how can i send data to database without repetition Pin
Blue_Boy13-Sep-08 23:59
Blue_Boy13-Sep-08 23:59 
AnswerRe: how can i send data to database without repetition Pin
nelsonpaixao14-Sep-08 12:51
nelsonpaixao14-Sep-08 12:51 

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.