Click here to Skip to main content
15,887,585 members
Home / Discussions / C#
   

C#

 
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 
Hi,

Instead of dragging two buttons onto the form, you can very well use two buttons on the toolbar.Or even create a 'toolbox' like the one you find in the 'MS Paint' software. I dragged and dropped two buttons (as example) onto the form just to demonstrate how to draw an ellipse interactively!

But why do you want to click button titled 'Ellipse' when you click button titled 'None' automatically? My code is just a demonstration. The reason why I used two buttons are these :

1) There may be times when you don't want your program to draw an ellipse when the left mouse button is pressed and dragged on the form. So how to indicate to the program that you want to stop drawing ellipse? Set the variable 'SelectedShape' to 'None'.

2) Later when you want to again start drawing an ellipse, you click second button titled 'Ellipse' to save 'SelectedShape' to 'Ellipse'. The program now knows that it has to draw an ellipse whenever you press the left mouse button down and drag the mouse. How ? Because, the variable 'SelectedShape' now hold the value 'Ellipse'.

The purpose of the buttons is therefore to set a value for the 'SelectedShape' variable. The value set in this variable will be used by the code in the 'Paint' event to either draw an ellipse (if the varilable is set to 'Ellipse') or not to draw anything ( if the variable is set to 'None'). It is just my logic. You can design your own!

Now, if you want to click 'None' button automatically when you click the 'ellipse' button what do you expect the program to do ? To draw an ellipse or not ?

It may be possible to automatically click button 'None' when button 'Ellipse' is also clicked. But in this case it does not seem to logical as these two buttons do two opposite things!
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 
AnswerRe: OOB design - class fields Pin
Nish Nishant16-Oct-10 6:27
sitebuilderNish Nishant16-Oct-10 6:27 
AnswerRe: OOB design - class fields Pin
Paul Michalik17-Oct-10 0:45
Paul Michalik17-Oct-10 0:45 
QuestionRead the 'raw' FileVersion and ProductVersion values from a file's version resource. Pin
Blake Miller15-Oct-10 13:02
Blake Miller15-Oct-10 13:02 
QuestionApplication Settings "Save Location" Pin
I Believe In GOD15-Oct-10 10:30
I Believe In GOD15-Oct-10 10:30 
AnswerRe: Application Settings "Save Location" Pin
Ian Shlasko15-Oct-10 10:34
Ian Shlasko15-Oct-10 10:34 
GeneralRe: Application Settings "Save Location" Pin
I Believe In GOD15-Oct-10 10:46
I Believe In GOD15-Oct-10 10:46 
GeneralRe: Application Settings "Save Location" Pin
AspDotNetDev15-Oct-10 12:29
protectorAspDotNetDev15-Oct-10 12:29 
QuestionHow to create a user control with parameters as tags Pin
kuul1315-Oct-10 10:17
kuul1315-Oct-10 10:17 
AnswerRe: How to create a user control with parameters as tags Pin
Not Active15-Oct-10 11:47
mentorNot Active15-Oct-10 11:47 

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.