Click here to Skip to main content
15,896,306 members
Home / Discussions / C#
   

C#

 
AnswerRe: removing the changes done to an image Pin
riced15-May-10 0:43
riced15-May-10 0:43 
AnswerRe: removing the changes done to an image Pin
Sandeep Mewara15-May-10 19:27
mveSandeep Mewara15-May-10 19:27 
Questionproblem with attaching an existing project to another project Pin
prasadbuddhika14-May-10 20:42
prasadbuddhika14-May-10 20:42 
AnswerRe: problem with attaching an existing project to another project Pin
#realJSOP14-May-10 23:21
professional#realJSOP14-May-10 23:21 
AnswerRe: problem with attaching an existing project to another project Pin
PIEBALDconsult15-May-10 5:23
mvePIEBALDconsult15-May-10 5:23 
AnswerRe: problem with attaching an existing project to another project Pin
Luc Pattyn15-May-10 7:04
sitebuilderLuc Pattyn15-May-10 7:04 
AnswerRe: problem with attaching an existing project to another project Pin
prasadbuddhika16-May-10 22:02
prasadbuddhika16-May-10 22:02 
QuestionSo I Tried Graphics Tonight For The First Time Pin
Roger Wright14-May-10 19:42
professionalRoger Wright14-May-10 19:42 
Big mistake...

I've avoided it for decades, as Windows makes it so hard to do - at least through the eyes of a tyro. But it's time I learned it, and I sat down tonight intending to do so. I thought I'd start with drawing a simple circle on a form, and searching in Help returned a likely bit with sample code for drawing a rectangle and a circle within it, along with a button_Click handler to call the drawing function. I copied and pasted the sample code into my 800x600 form, just to try it out. Then I added a button1 object to provide the event. The code is:

public partial class FlowCalcs : Form
    {
        public FlowCalcs()
        {
            InitializeComponent();
        }
        private void DrawIt()
        {
            System.Drawing.Graphics graphics = this.CreateGraphics();
            System.Drawing.Rectangle rectangle = new System.Drawing.Rectangle(
               100, 100, 200, 200);
            graphics.DrawEllipse(System.Drawing.Pens.Black, rectangle);
            graphics.DrawRectangle(System.Drawing.Pens.Red, rectangle);
        }
        private void button1_Click(object sender, EventArgs e)
        {
            DrawIt();
        }
    }


When I debugged it, absolutely nothing happened - no rectangle, no circle, and no errors. I would welcome an error message, since occasionally Microsoft divulges some tiny bit of information that Google can find a solution for. But no such luck this time - it executes perfectly and does nothing.

Can someone lend a clue to the clueless? I haven't any idea where to go next...
"A Journey of a Thousand Rest Stops Begins with a Single Movement"

AnswerRe: So I Tried Graphics Tonight For The First Time Pin
AspDotNetDev14-May-10 20:09
protectorAspDotNetDev14-May-10 20:09 
AnswerRe: So I Tried Graphics Tonight For The First Time Pin
AspDotNetDev14-May-10 20:14
protectorAspDotNetDev14-May-10 20:14 
AnswerRe: So I Tried Graphics Tonight For The First Time Pin
Som Shekhar14-May-10 20:30
Som Shekhar14-May-10 20:30 
GeneralRe: So I Tried Graphics Tonight For The First Time Pin
AspDotNetDev14-May-10 21:01
protectorAspDotNetDev14-May-10 21:01 
GeneralRe: So I Tried Graphics Tonight For The First Time Pin
Pete O'Hanlon14-May-10 22:00
mvePete O'Hanlon14-May-10 22:00 
GeneralRe: So I Tried Graphics Tonight For The First Time Pin
OriginalGriff14-May-10 22:22
mveOriginalGriff14-May-10 22:22 
GeneralRe: So I Tried Graphics Tonight For The First Time Pin
Som Shekhar14-May-10 22:41
Som Shekhar14-May-10 22:41 
GeneralRe: So I Tried Graphics Tonight For The First Time Pin
OriginalGriff14-May-10 23:40
mveOriginalGriff14-May-10 23:40 
GeneralRe: So I Tried Graphics Tonight For The First Time Pin
Som Shekhar15-May-10 0:22
Som Shekhar15-May-10 0:22 
GeneralRe: So I Tried Graphics Tonight For The First Time Pin
Pete O'Hanlon15-May-10 5:55
mvePete O'Hanlon15-May-10 5:55 
GeneralRe: So I Tried Graphics Tonight For The First Time Pin
PIEBALDconsult15-May-10 5:00
mvePIEBALDconsult15-May-10 5:00 
GeneralRe: So I Tried Graphics Tonight For The First Time Pin
AspDotNetDev17-May-10 17:21
protectorAspDotNetDev17-May-10 17:21 
GeneralRe: So I Tried Graphics Tonight For The First Time Pin
OriginalGriff17-May-10 21:26
mveOriginalGriff17-May-10 21:26 
GeneralRe: So I Tried Graphics Tonight For The First Time Pin
AspDotNetDev17-May-10 21:33
protectorAspDotNetDev17-May-10 21:33 
GeneralRe: So I Tried Graphics Tonight For The First Time Pin
OriginalGriff17-May-10 21:49
mveOriginalGriff17-May-10 21:49 
AnswerRe: So I Tried Graphics Tonight For The First Time Pin
DaveyM6914-May-10 23:18
professionalDaveyM6914-May-10 23:18 
AnswerRe: So I Tried Graphics Tonight For The First Time Pin
Luc Pattyn15-May-10 2:18
sitebuilderLuc Pattyn15-May-10 2:18 

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.