Click here to Skip to main content
15,890,579 members
Home / Discussions / C#
   

C#

 
GeneralMessage Removed Pin
15-Oct-10 16:30
WebMaster15-Oct-10 16:30 
GeneralRe: Ellipse Pin
Richard Andrew x6415-Oct-10 16:33
professionalRichard Andrew x6415-Oct-10 16:33 
GeneralRe: Ellipse Pin
WebMaster15-Oct-10 16:47
WebMaster15-Oct-10 16:47 
GeneralRe: Ellipse Pin
Richard Andrew x6415-Oct-10 16:53
professionalRichard Andrew x6415-Oct-10 16:53 
GeneralRe: Ellipse Pin
WebMaster15-Oct-10 17:01
WebMaster15-Oct-10 17:01 
GeneralRe: Ellipse Pin
Richard Andrew x6415-Oct-10 17:03
professionalRichard Andrew x6415-Oct-10 17:03 
GeneralRe: Ellipse Pin
Richard Andrew x6415-Oct-10 17:36
professionalRichard Andrew x6415-Oct-10 17:36 
GeneralRe: Ellipse Pin
WebMaster16-Oct-10 8:24
WebMaster16-Oct-10 8:24 
Thanks for the info about rubberbanding; I will try to find these articles. The Ellipse to screen I tried did not work. I got this info from a book VisualC# 2005 Express edition by Aneesha Bakharia. It works great for the Line or Rectangle. I just cannot get it to work on the Ellipse. Here is what I did for the Rectangle.
public partial class Form1 : Form
{
//Create variables to store rectangle object
Rectangle SelectionRectangle = new Rectangle();
Point StartPoint = new Point();
Point EndPoint = new Point();
string SelectedShape = "Rectangle";
public void OnMouseDown_Handler(Object sender, MouseEventArgs e)
{
//mousedown can capture start coordinates and reset rectangle
SelectionRectangle.Width = 0;
SelectionRectangle.Height = 0;
SelectionRectangle.X = e.X;
SelectionRectangle.Y = e.Y;

StartPoint.X = e.X;
StartPoint.Y = e.Y;
EndPoint = StartPoint;
}
else if (SelectedShape == "Rectangle") //This is during mouse move
{
ControlPaint.DrawReversibleFrame(CurrentForm.RectangleToScreen(SelectionRectangle),
Color.Black, FrameStyle.Dashed);
SelectionRectangle.Width = e.X - SelectionRectangle.X;
SelectionRectangle.Height = e.Y - SelectionRectangle.Y;
ControlPaint.DrawReversibleFrame(CurrentForm.RectangleToScreen(SelectionRectangle),
Color.Black, FrameStyle.Dashed);
else if (SelectedShape == "Rectangle") //This is during mouse up
{
ControlPaint.DrawReversibleFrame(CurrentForm.RectangleToScreen(SelectionRectangle),
Color.Black, FrameStyle.Dashed);
g.DrawRectangle(pen, SelectionRectangle);
}
g.Dispose();
AnswerRe: Ellipse Pin
Not Active16-Oct-10 8:47
mentorNot Active16-Oct-10 8:47 
GeneralRe: Ellipse Pin
WebMaster16-Oct-10 9:02
WebMaster16-Oct-10 9:02 
GeneralRe: Ellipse Pin
Lamrin17-Oct-10 0:09
Lamrin17-Oct-10 0:09 
GeneralRe: Ellipse Pin
WebMaster17-Oct-10 7:57
WebMaster17-Oct-10 7:57 
GeneralRe: Ellipse Pin
WebMaster17-Oct-10 8:05
WebMaster17-Oct-10 8:05 
GeneralRe: Ellipse Pin
Lamrin17-Oct-10 15:46
Lamrin17-Oct-10 15:46 
GeneralRe: Ellipse Pin
WebMaster18-Oct-10 5:16
WebMaster18-Oct-10 5:16 
GeneralRe: Ellipse Pin
WebMaster20-Oct-10 8:21
WebMaster20-Oct-10 8:21 
GeneralRe: Ellipse Pin
Lamrin23-Oct-10 6:24
Lamrin23-Oct-10 6:24 
GeneralRe: Ellipse Pin
WebMaster24-Oct-10 8:10
WebMaster24-Oct-10 8:10 
GeneralRe: Ellipse Pin
Lamrin25-Oct-10 5:15
Lamrin25-Oct-10 5:15 
GeneralRe: Ellipse Pin
WebMaster25-Oct-10 9:27
WebMaster25-Oct-10 9:27 
QuestionOOB design - class fields Pin
Dell.Simmons15-Oct-10 13:41
Dell.Simmons15-Oct-10 13:41 
AnswerRe: OOB design - class fields Pin
ricmil4215-Oct-10 14:29
ricmil4215-Oct-10 14:29 
GeneralRe: OOB design - class fields Pin
Dell.Simmons15-Oct-10 14:34
Dell.Simmons15-Oct-10 14:34 
AnswerRe: OOB design - class fields Pin
Abhinav S15-Oct-10 22:25
Abhinav S15-Oct-10 22:25 
AnswerRe: OOB design - class fields Pin
Keith Barrow16-Oct-10 5:40
professionalKeith Barrow16-Oct-10 5:40 

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.