Click here to Skip to main content
15,885,546 members
Home / Discussions / C#
   

C#

 
QuestionForm Header Pin
jojoba201113-Mar-10 19:30
jojoba201113-Mar-10 19:30 
AnswerRe: Form Header Pin
Kristian Sixhøj14-Mar-10 1:25
Kristian Sixhøj14-Mar-10 1:25 
Questionto draw a line parallel to the existing line Pin
v17.poornima13-Mar-10 17:56
v17.poornima13-Mar-10 17:56 
AnswerRe: to draw a line parallel to the existing line Pin
Saksida Bojan13-Mar-10 18:58
Saksida Bojan13-Mar-10 18:58 
GeneralRe: to draw a line parallel to the existing line Pin
v17.poornima14-Mar-10 18:42
v17.poornima14-Mar-10 18:42 
AnswerRe: to draw a line parallel to the existing line Pin
dan!sh 13-Mar-10 19:12
professional dan!sh 13-Mar-10 19:12 
GeneralRe: to draw a line parallel to the existing line Pin
v17.poornima14-Mar-10 18:41
v17.poornima14-Mar-10 18:41 
AnswerRe: to draw a line parallel to the existing line Pin
OriginalGriff13-Mar-10 23:12
mveOriginalGriff13-Mar-10 23:12 
v17.poornima wrote:
he user may start drawing from anywhere with any angle. So using the draw rectangle i cannot draw that.


Yes you can!
private Point startPoint = new Point(0,0);
 private Point endPoint = new Point(0,0);
 private bool drawing = false;
 private void panel1_MouseDown(object sender, MouseEventArgs e)
     {
     startPoint = e.Location;
     endPoint = e.Location;
     panel1.Invalidate();
     drawing = true;
     }

 private void panel1_MouseMove(object sender, MouseEventArgs e)
     {
     if (drawing)
         {
         endPoint = e.Location;
         panel1.Invalidate();
         }
     }

 private void panel1_MouseUp(object sender, MouseEventArgs e)
     {
     drawing = false;
     }

 private void panel1_Paint(object sender, PaintEventArgs e)
     {
     if (!((startPoint.X == endPoint.X) && (startPoint.Y == endPoint.Y)))
         {
         Rectangle r = new Rectangle(startPoint.X, startPoint.Y, endPoint.X - startPoint.X, endPoint.Y - startPoint.Y);
         e.Graphics.DrawRectangle(Pens.Black, r);
         }
     }
This only draws the rectangle in one quadrant of the four possible, but it is a simple matter to ensure it draws in all four.
You should never use standby on an elephant. It always crashes when you lift the ears. - Mark Wallace

C/C++ (I dont see a huge difference between them, and the 'benefits' of C++ are questionable, who needs inheritance when you have copy and paste) - fat_boy

AnswerRe: to draw a line parallel to the existing line Pin
Nicholas Butler14-Mar-10 9:25
sitebuilderNicholas Butler14-Mar-10 9:25 
Questionextract each character from image with text? Pin
Druuler13-Mar-10 17:52
Druuler13-Mar-10 17:52 
QuestionThe Right Terminology Pin
DotNetMan13-Mar-10 13:44
DotNetMan13-Mar-10 13:44 
AnswerCreative reposting Pin
Not Active13-Mar-10 14:41
mentorNot Active13-Mar-10 14:41 
GeneralRe: Creative reposting Pin
DotNetMan13-Mar-10 14:57
DotNetMan13-Mar-10 14:57 
AnswerRe: The Right Terminology Pin
Rod Kemp13-Mar-10 19:44
Rod Kemp13-Mar-10 19:44 
GeneralRe: The Right Terminology Pin
#realJSOP13-Mar-10 21:43
mve#realJSOP13-Mar-10 21:43 
GeneralRe: The Right Terminology Pin
Rod Kemp13-Mar-10 23:21
Rod Kemp13-Mar-10 23:21 
GeneralRe: The Right Terminology Pin
DotNetMan14-Mar-10 2:59
DotNetMan14-Mar-10 2:59 
GeneralRe: The Right Terminology Pin
Rod Kemp14-Mar-10 3:36
Rod Kemp14-Mar-10 3:36 
QuestionMoving (animating like a Tooltip) a Child form using mouse coordinates while keeping focus on the parent form Pin
boreland13-Mar-10 9:41
boreland13-Mar-10 9:41 
AnswerRe: Moving (animating like a Tooltip) a Child form using mouse coordinates while keeping focus on the parent form Pin
boreland13-Mar-10 9:55
boreland13-Mar-10 9:55 
GeneralRe: Moving (animating like a Tooltip) a Child form using mouse coordinates while keeping focus on the parent form Pin
Not Active13-Mar-10 10:06
mentorNot Active13-Mar-10 10:06 
QuestionDocumentation Pin
jojoba201113-Mar-10 6:14
jojoba201113-Mar-10 6:14 
AnswerRe: Documentation Pin
Not Active13-Mar-10 6:26
mentorNot Active13-Mar-10 6:26 
QuestionRe: Documentation [modified] Pin
jojoba201113-Mar-10 6:52
jojoba201113-Mar-10 6:52 
AnswerRe: Documentation Pin
Not Active13-Mar-10 7:10
mentorNot Active13-Mar-10 7:10 

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.