Click here to Skip to main content
15,892,005 members
Home / Discussions / C#
   

C#

 
QuestionUnable to create a 2-Dimensional Array for Database Records............... Pin
Reality Strikes14-Jul-08 10:23
Reality Strikes14-Jul-08 10:23 
AnswerRe: Unable to create a 2-Dimensional Array for Database Records............... Pin
led mike14-Jul-08 10:43
led mike14-Jul-08 10:43 
GeneralRe: Unable to create a 2-Dimensional Array for Database Records............... Pin
Reality Strikes14-Jul-08 10:56
Reality Strikes14-Jul-08 10:56 
GeneralRe: Unable to create a 2-Dimensional Array for Database Records............... Pin
Reality Strikes14-Jul-08 10:59
Reality Strikes14-Jul-08 10:59 
GeneralRe: Unable to create a 2-Dimensional Array for Database Records............... Pin
led mike14-Jul-08 11:09
led mike14-Jul-08 11:09 
GeneralRe: Unable to create a 2-Dimensional Array for Database Records............... Pin
Reality Strikes15-Jul-08 3:20
Reality Strikes15-Jul-08 3:20 
GeneralRe: Unable to create a 2-Dimensional Array for Database Records............... Pin
led mike15-Jul-08 5:36
led mike15-Jul-08 5:36 
QuestionDragable rectangles Pin
Casper Hansen14-Jul-08 9:22
Casper Hansen14-Jul-08 9:22 
Hello.

I have a question..

I have this script:
int mouseDownX;
        int mouseDownY;

        int width;
        int height;

        private void Form1_MouseUp(object sender, MouseEventArgs mouseEv)
        {
            width = mouseEv.X - mouseDownX;
            height = mouseEv.Y - mouseDownY;

            textBox2.Text = Convert.ToString(mouseEv.Location);

            Graphics graphics = this.CreateGraphics();

            Rectangle rectangle = new Rectangle(
                    mouseDownX, mouseDownY, width, height);

            graphics.DrawRectangle(Pens.Red, rectangle);
        }

        private void Form1_MouseDown(object sender, MouseEventArgs mouseEv)
        {
            textBox1.Text = Convert.ToString(mouseEv.Location);

            mouseDownX = mouseEv.X;
            mouseDownY = mouseEv.Y;
        }


Which works fine if I make a rectangle from the left top corner to the right bottom corner

But is there any easier way of just making rectangles?

Here is a video of what I want:
http://www.youtube.com/watch?v=V5YO4U1UnO0

And here is a download link to my project:
http://peecee.dk/upload/download/123329

So I want to be able to draw rectangles from any angle if you understand?
AnswerRe: Dragable rectangles Pin
C1AllenS14-Jul-08 9:50
C1AllenS14-Jul-08 9:50 
GeneralRe: Dragable rectangles Pin
Luc Pattyn14-Jul-08 10:14
sitebuilderLuc Pattyn14-Jul-08 10:14 
AnswerRe: Dragable rectangles Pin
Casper Hansen15-Jul-08 2:58
Casper Hansen15-Jul-08 2:58 
QuestionHelp needed Pin
SHINOJK14-Jul-08 8:23
SHINOJK14-Jul-08 8:23 
QuestionSame Random Numbers Pin
humayunlalzad14-Jul-08 5:27
humayunlalzad14-Jul-08 5:27 
AnswerRe: Same Random Numbers Pin
DaveyM6914-Jul-08 5:34
professionalDaveyM6914-Jul-08 5:34 
GeneralRe: Same Random Numbers Pin
humayunlalzad14-Jul-08 5:36
humayunlalzad14-Jul-08 5:36 
GeneralRe: Same Random Numbers Pin
leppie14-Jul-08 5:38
leppie14-Jul-08 5:38 
GeneralRe: Same Random Numbers Pin
humayunlalzad14-Jul-08 5:52
humayunlalzad14-Jul-08 5:52 
GeneralRe: Same Random Numbers Pin
leppie14-Jul-08 5:54
leppie14-Jul-08 5:54 
GeneralRe: Same Random Numbers Pin
humayunlalzad14-Jul-08 5:57
humayunlalzad14-Jul-08 5:57 
GeneralRe: Same Random Numbers Pin
DaveyM6914-Jul-08 6:07
professionalDaveyM6914-Jul-08 6:07 
GeneralRe: Same Random Numbers Pin
humayunlalzad14-Jul-08 6:17
humayunlalzad14-Jul-08 6:17 
GeneralRe: Same Random Numbers Pin
Colin Angus Mackay14-Jul-08 11:48
Colin Angus Mackay14-Jul-08 11:48 
GeneralRe: Same Random Numbers Pin
humayunlalzad14-Jul-08 18:51
humayunlalzad14-Jul-08 18:51 
GeneralRe: Same Random Numbers Pin
humayunlalzad14-Jul-08 6:53
humayunlalzad14-Jul-08 6:53 
GeneralRe: Same Random Numbers Pin
leppie14-Jul-08 6:55
leppie14-Jul-08 6:55 

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.