Click here to Skip to main content
15,903,724 members
Home / Discussions / C#
   

C#

 
QuestionFiltering dataset Pin
Muammar©7-May-07 22:24
Muammar©7-May-07 22:24 
AnswerRe: Filtering dataset Pin
rah_sin7-May-07 22:30
professionalrah_sin7-May-07 22:30 
AnswerRe: Filtering dataset Pin
Giorgi Dalakishvili7-May-07 22:35
mentorGiorgi Dalakishvili7-May-07 22:35 
Questionwindow application problem - plz help Pin
Sekar Kumarasamy7-May-07 22:19
Sekar Kumarasamy7-May-07 22:19 
AnswerRe: window application problem - plz help Pin
rah_sin7-May-07 22:28
professionalrah_sin7-May-07 22:28 
AnswerRe: window application problem - plz help Pin
Christian Graus7-May-07 22:33
protectorChristian Graus7-May-07 22:33 
GeneralRe: window application problem - plz help Pin
prabuinet8-May-07 3:48
prabuinet8-May-07 3:48 
QuestionDrawing line in running time [modified] Pin
HexaDeveloper7-May-07 21:37
HexaDeveloper7-May-07 21:37 
hi all,
i write this code to draw line by mouse and the drawline method is in the onPaint() method,this code is working properly but has two problems so is there any other idea to code it

 private void mainScreen_MouseMove(object sender, MouseEventArgs e)<br />
        {<br />
<br />
            /// Determine the End point of the line<br />
            if (lineFlag == 1 && !(mLineBeginPnt.IsEmpty) && nextLineFlag == 1)<br />
            {<br />
                Graphics grfx = this.CreateGraphics();<br />
                Pen pen = new Pen(mainScreen.DefaultBackColor, 2);<br />
                userInterface.handleMouseMove(grfx, ref lastPntOfLine,<br />
                   ref lastPntCounter, pen, ref mLineEndPnt, mLineBeginPnt, e.Location);<br />
                pen.Dispose();<br />
                grfx.Dispose();<br />
                Invalidate(drawingFrame);<br />
            }<br />
<br />
        }<br />
----------------------------------------<br />
 public void handleMouseMove(Graphics grfx,ref Point lastPntOfLine,<br />
            ref int lastPntCounter, Pen pen, ref Point mLineEndPnt, Point mLineBeginPnt,<br />
            Point location)<br />
        {<br />
            if (lastPntCounter == 0)<br />
            {<br />
                lastPntOfLine = location;<br />
                lastPntCounter++;<br />
            }<br />
            else<br />
                grfx.DrawLine(pen, mLineBeginPnt, lastPntOfLine);<br />
            mLineEndPnt = location;<br />
            Pen p = new Pen(Color.Black, 2);<br />
            grfx.DrawLine(p, mLineBeginPnt, mLineEndPnt);<br />
            lastPntOfLine = location;<br />
            grfx.Dispose();<br />
            pen.Dispose();<br />
            p.Dispose();<br />
            <br />
        }<br />

what i made in this code is that i determine the last line drawen by nouse by getting its begin and end points from line object that i have then draw this line by background color to hide it and draw new line with black color to seen by user
(this code is an alternative for using XOR mode, if any one know how to use it with drawing lines please tell me)

thanks



Generator


-- modified at 4:12 Tuesday 8th May, 2007
AnswerRe: Drawing line in running time Pin
Christian Graus7-May-07 22:14
protectorChristian Graus7-May-07 22:14 
GeneralRe: Drawing line in running time Pin
HexaDeveloper7-May-07 23:00
HexaDeveloper7-May-07 23:00 
Questionconnect XML file with App.?? Pin
yazeed_pal7-May-07 20:47
yazeed_pal7-May-07 20:47 
AnswerRe: connect XML file with App.?? Pin
Sandeep Akhare7-May-07 20:58
Sandeep Akhare7-May-07 20:58 
AnswerRe: connect XML file with App.?? Pin
blackjack21507-May-07 21:24
blackjack21507-May-07 21:24 
QuestionCreateObject Method Pin
danasegaranea7-May-07 20:02
danasegaranea7-May-07 20:02 
AnswerRe: CreateObject Method Pin
Muammar©7-May-07 20:12
Muammar©7-May-07 20:12 
AnswerRe: CreateObject Method Pin
Sandeep Akhare7-May-07 20:23
Sandeep Akhare7-May-07 20:23 
GeneralRe: CreateObject Method Pin
danasegaranea7-May-07 20:34
danasegaranea7-May-07 20:34 
QuestionRe: CreateObject Method Pin
Sandeep Akhare7-May-07 20:39
Sandeep Akhare7-May-07 20:39 
AnswerRe: CreateObject Method [modified] Pin
danasegaranea7-May-07 21:00
danasegaranea7-May-07 21:00 
GeneralRe: CreateObject Method Pin
Sandeep Akhare7-May-07 21:15
Sandeep Akhare7-May-07 21:15 
GeneralRe: CreateObject Method Pin
danasegaranea8-May-07 3:09
danasegaranea8-May-07 3:09 
AnswerRe: CreateObject Method Pin
J4amieC7-May-07 22:15
J4amieC7-May-07 22:15 
GeneralRe: CreateObject Method Pin
danasegaranea7-May-07 22:20
danasegaranea7-May-07 22:20 
GeneralRe: CreateObject Method Pin
Pete O'Hanlon7-May-07 22:33
mvePete O'Hanlon7-May-07 22:33 
GeneralRe: CreateObject Method Pin
J4amieC8-May-07 0:07
J4amieC8-May-07 0:07 

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.