Click here to Skip to main content
15,897,371 members
Home / Discussions / C#
   

C#

 
AnswerRe: Populating loaded web form within c# Pin
Parwej Ahamad13-Jun-08 6:05
professionalParwej Ahamad13-Jun-08 6:05 
QuestionInstall Printer on VISTA with WMI automated in C# without local Admin Rights Pin
DanyS13-Jun-08 5:02
professionalDanyS13-Jun-08 5:02 
QuestionwebBrowser1 Control and NT Authentication Pin
Brad Wick13-Jun-08 4:35
Brad Wick13-Jun-08 4:35 
AnswerRe: webBrowser1 Control and NT Authentication Pin
led mike13-Jun-08 5:19
led mike13-Jun-08 5:19 
QuestionWht is Static? Pin
ashwinibhalerao13-Jun-08 4:17
ashwinibhalerao13-Jun-08 4:17 
AnswerRe: Wht is Static? Pin
Anthony Mushrow13-Jun-08 4:20
professionalAnthony Mushrow13-Jun-08 4:20 
GeneralRe: Wht is Static? Pin
Simon P Stevens13-Jun-08 4:39
Simon P Stevens13-Jun-08 4:39 
QuestionClicking on a drawn line Pin
Gareth H13-Jun-08 4:09
Gareth H13-Jun-08 4:09 
I call the below code from the MouseClick event of a control. However, it doesnt seem a good idea to be constantly creating gfx objects every time the user clicks the mouse.

private void ClickedEdge(Point mousePoint)
{
    _selectedEdge = null;
    Graphics gfx = this.CreateGraphics();
    Rectangle clickedRect = new Rectangle(mousePoint, new Size(1, 1));

    foreach (EdgeObj edge in _edgeItems)
    {
        Rectangle edgeRect = Rectangle.Round(edge.Region.GetBounds(gfx));
        if (clickedRect.IntersectsWith(edgeRect))
        {
            _selectedEdge = edge;
            break;
        }
    }
}


So, does anyone know of a better way to find out if the mouse has clicked on a line which has been drawn onto the control?

Regards,
Gareth.

(FKA gareth111)

AnswerRe: Clicking on a drawn line Pin
User 665813-Jun-08 4:31
User 665813-Jun-08 4:31 
AnswerRe: Clicking on a drawn line [modified] Pin
Anthony Mushrow13-Jun-08 4:33
professionalAnthony Mushrow13-Jun-08 4:33 
GeneralRe: Clicking on a drawn line Pin
Gareth H13-Jun-08 7:16
Gareth H13-Jun-08 7:16 
GeneralRe: Clicking on a drawn line Pin
Anthony Mushrow13-Jun-08 7:19
professionalAnthony Mushrow13-Jun-08 7:19 
GeneralRe: Clicking on a drawn line Pin
Gareth H13-Jun-08 7:31
Gareth H13-Jun-08 7:31 
GeneralRe: Clicking on a drawn line Pin
Anthony Mushrow13-Jun-08 8:09
professionalAnthony Mushrow13-Jun-08 8:09 
QuestionCannot Save Personal settings Pin
humayunlalzad13-Jun-08 3:50
humayunlalzad13-Jun-08 3:50 
AnswerRe: Cannot Save Personal settings Pin
leppie13-Jun-08 3:51
leppie13-Jun-08 3:51 
GeneralRe: Cannot Save Personal settings Pin
humayunlalzad13-Jun-08 4:07
humayunlalzad13-Jun-08 4:07 
AnswerRe: Cannot Save Personal settings Pin
Ashfield13-Jun-08 4:13
Ashfield13-Jun-08 4:13 
GeneralRe: Cannot Save Personal settings Pin
humayunlalzad13-Jun-08 4:28
humayunlalzad13-Jun-08 4:28 
GeneralRe: Cannot Save Personal settings Pin
Ashfield13-Jun-08 5:11
Ashfield13-Jun-08 5:11 
GeneralRe: Cannot Save Personal settings Pin
leppie13-Jun-08 5:18
leppie13-Jun-08 5:18 
GeneralRe: Cannot Save Personal settings Pin
humayunlalzad13-Jun-08 5:34
humayunlalzad13-Jun-08 5:34 
GeneralRe: Cannot Save Personal settings Pin
leppie13-Jun-08 6:10
leppie13-Jun-08 6:10 
QuestionHow to merge the 2 tables of a dataset using c#, given the 2 tables contain same primary key with different content Pin
dotNetKeen13-Jun-08 3:41
dotNetKeen13-Jun-08 3:41 
AnswerRe: How to merge the 2 tables of a dataset using c#, given the 2 tables contain same primary key with different content Pin
leppie13-Jun-08 5:20
leppie13-Jun-08 5:20 

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.