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

C#

 
GeneralC#, using MS Interop, how to reasonably use an instance for spell check Pin
Letmelogin6-Apr-08 5:34
Letmelogin6-Apr-08 5:34 
GeneralOutOfMemoryException despite having 600+ MB of RAM free Pin
Jordanwb6-Apr-08 4:25
Jordanwb6-Apr-08 4:25 
QuestionRe: OutOfMemoryException despite having 600+ MB of RAM free Pin
CPallini6-Apr-08 4:39
mveCPallini6-Apr-08 4:39 
GeneralRe: OutOfMemoryException despite having 600+ MB of RAM free Pin
Jordanwb6-Apr-08 4:46
Jordanwb6-Apr-08 4:46 
GeneralRe: OutOfMemoryException despite having 600+ MB of RAM free Pin
CPallini6-Apr-08 6:23
mveCPallini6-Apr-08 6:23 
GeneralRe: OutOfMemoryException despite having 600+ MB of RAM free Pin
Jordanwb6-Apr-08 6:31
Jordanwb6-Apr-08 6:31 
GeneralRe: OutOfMemoryException despite having 600+ MB of RAM free Pin
Guffa6-Apr-08 6:11
Guffa6-Apr-08 6:11 
QuestionInvalidate picturebox with rectangle on Pin
Casper Hansen6-Apr-08 3:49
Casper Hansen6-Apr-08 3:49 
Hello.

I have a simple picturebox where there is a image loaded in

Im drawing a rectangle on the picturebox and when I press a button I want to invalidate it (remove the rectangle), but it doesnt seem to work

The rectangle is drawn fine and the image loads up to, but when I press my button nothing happens

Here is the code im using:
        private void drawOnPic()<br />
        {<br />
            // Attach grapich to picturebox<br />
            Graphics g = Graphics.FromImage(pictureBox1.Image);<br />
<br />
            // Create a new pen that we shall use for drawing the line<br />
            Pen PenStyle = new Pen(Color.Red, 1);<br />
<br />
            // Draw a 50x50 pixels rectangle (x, y, width, hight)<br />
            g.DrawRectangle(PenStyle, 20, 20, 50, 50);<br />
        }<br />
<br />
        private void button1_Click(object sender, EventArgs e)<br />
        {<br />
            pictureBox1.Invalidate();<br />
        }<br />
<br />
        private void Form1_Load(object sender, EventArgs e)<br />
        {<br />
            drawOnPic();<br />
        }

GeneralRe: Invalidate picturebox with rectangle on Pin
Luc Pattyn6-Apr-08 5:05
sitebuilderLuc Pattyn6-Apr-08 5:05 
Questionhow to validate a textbox in a window Form Pin
yangliuxiaowu6-Apr-08 1:40
yangliuxiaowu6-Apr-08 1:40 
AnswerRe: how to validate a textbox in a window Form Pin
Luc Pattyn6-Apr-08 5:08
sitebuilderLuc Pattyn6-Apr-08 5:08 
Questionselect domain name part of a url saved in a string Pin
Farhad Eft6-Apr-08 1:25
Farhad Eft6-Apr-08 1:25 
GeneralRe: select domain name part of a url saved in a string Pin
Ryan Bost6-Apr-08 5:22
Ryan Bost6-Apr-08 5:22 
GeneralRe: select domain name part of a url saved in a string Pin
Farhad Eft8-Apr-08 5:59
Farhad Eft8-Apr-08 5:59 
GeneralSoapFormatter: Ignore missing fields Pin
Roger Alsing5-Apr-08 23:24
Roger Alsing5-Apr-08 23:24 
QuestionHow to change caption text in default ColorDialog ? Pin
eslange5-Apr-08 23:03
eslange5-Apr-08 23:03 
GeneralPublish XNA Project (Please?) [modified] Pin
MasterSharp5-Apr-08 12:03
MasterSharp5-Apr-08 12:03 
GeneralRe: Publish XNA Project (Please?) Pin
MarkB7775-Apr-08 17:22
MarkB7775-Apr-08 17:22 
GeneralRe: Publish XNA Project (Please?) Pin
MasterSharp6-Apr-08 3:33
MasterSharp6-Apr-08 3:33 
QuestionTaking a screen shot of a control Pin
nike_arh5-Apr-08 11:24
nike_arh5-Apr-08 11:24 
GeneralRe: Taking a screen shot of a control Pin
nike_arh5-Apr-08 11:36
nike_arh5-Apr-08 11:36 
GeneralRe: Taking a screen shot of a control Pin
Matthew Butler5-Apr-08 11:41
Matthew Butler5-Apr-08 11:41 
GeneralRe: Taking a screen shot of a control Pin
Anthony Mushrow5-Apr-08 12:50
professionalAnthony Mushrow5-Apr-08 12:50 
GeneralRe: Taking a screen shot of a control Pin
nike_arh5-Apr-08 22:57
nike_arh5-Apr-08 22:57 
GeneralRe: Taking a screen shot of a control Pin
Anthony Mushrow6-Apr-08 0:32
professionalAnthony Mushrow6-Apr-08 0:32 

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.