Click here to Skip to main content
15,905,875 members
Home / Discussions / C#
   

C#

 
GeneralRe: Dynamic array of PictureBoxes with scroll-bars? Pin
Luc Pattyn17-Oct-10 10:41
sitebuilderLuc Pattyn17-Oct-10 10:41 
GeneralRe: Dynamic array of PictureBoxes with scroll-bars? Pin
forkus200024-Oct-10 19:15
forkus200024-Oct-10 19:15 
GeneralRe: Dynamic array of PictureBoxes with scroll-bars? Pin
Luc Pattyn25-Oct-10 2:09
sitebuilderLuc Pattyn25-Oct-10 2:09 
QuestionEllipse Pin
WebMaster15-Oct-10 15:17
WebMaster15-Oct-10 15:17 
AnswerRe: Ellipse Pin
Richard Andrew x6415-Oct-10 16:16
professionalRichard Andrew x6415-Oct-10 16:16 
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 
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 
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 

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.