Click here to Skip to main content
15,891,704 members
Home / Discussions / C#
   

C#

 
QuestionLock DLL in C# Pin
jojoba20112-Sep-11 20:53
jojoba20112-Sep-11 20:53 
AnswerRe: Lock DLL in C# Pin
Abhinav S2-Sep-11 21:25
Abhinav S2-Sep-11 21:25 
AnswerRe: Lock DLL in C# Pin
harold aptroot3-Sep-11 1:32
harold aptroot3-Sep-11 1:32 
AnswerRe: Lock DLL in C# PinPopular
jschell3-Sep-11 10:43
jschell3-Sep-11 10:43 
GeneralRe: Lock DLL in C# Pin
Eddy Vluggen3-Sep-11 13:04
professionalEddy Vluggen3-Sep-11 13:04 
QuestionEmailSender : A socket operation was attempted to an unreachable network Pin
bigz_10002-Sep-11 19:53
bigz_10002-Sep-11 19:53 
AnswerRe: EmailSender : A socket operation was attempted to an unreachable network Pin
Mehdi Gholam2-Sep-11 20:03
Mehdi Gholam2-Sep-11 20:03 
Question[SOLVED] "Negative" Rectangle (ControlPaint.DrawReversibleFrame) To "Positive" Pin
Matt U.2-Sep-11 13:39
Matt U.2-Sep-11 13:39 
I am using ControlPaint.DrawReversibleFrame to draw a frame while the user clicks/drags on a control. All is well there. Once complete, I do some things with the information, including drawing to the control using rectangle used to draw the frame. However, if I drag backward OR upward, I end up with nothing because it has negative values. How can I correct this? Sorry if I did not explain well enough, I am busy with things at home. But I can elaborate later if necessary.

SOLUTION:

Basic math

C#
if (finalRect.Width < 0)
{
    finalRect.X = (finalRect.X + finalRect.Width);
    finalRect.Width = Math.Abs(finalRect.Width);
}
if (finalRect.Height < 0)
{
    finalRect.Y = (finalRect.Y + finalRect.Height);
    finalRect.Height = Math.Abs(finalRect.Height);
}

djj55: Nice but may have a permission problem
Pete O'Hanlon: He has my permission to run it.
modified on Friday, September 2, 2011 8:54 PM

QuestionC# code for windows Pin
dcof2-Sep-11 6:45
dcof2-Sep-11 6:45 
AnswerRe: C# code for windows Pin
Abhinav S2-Sep-11 6:59
Abhinav S2-Sep-11 6:59 
QuestionRe: C# code for windows Pin
dcof2-Sep-11 18:13
dcof2-Sep-11 18:13 
AnswerMessage Removed Pin
2-Sep-11 7:05
professionalN_tro_P2-Sep-11 7:05 
GeneralRe: C# code for windows Pin
Luc Pattyn2-Sep-11 7:15
sitebuilderLuc Pattyn2-Sep-11 7:15 
GeneralRe: C# code for windows Pin
Abhinav S2-Sep-11 8:01
Abhinav S2-Sep-11 8:01 
QuestionRe: C# code for windows Pin
dcof2-Sep-11 8:34
dcof2-Sep-11 8:34 
AnswerRe: C# code for windows Pin
Abhinav S2-Sep-11 18:33
Abhinav S2-Sep-11 18:33 
GeneralRe: C# code for windows Pin
dcof2-Sep-11 8:19
dcof2-Sep-11 8:19 
GeneralRe: C# code for windows Pin
Richard Andrew x642-Sep-11 8:46
professionalRichard Andrew x642-Sep-11 8:46 
GeneralRe: C# code for windows Pin
dcof2-Sep-11 8:51
dcof2-Sep-11 8:51 
AnswerRe: C# code for windows Pin
OriginalGriff2-Sep-11 8:48
mveOriginalGriff2-Sep-11 8:48 
GeneralRe: C# code for windows Pin
dcof2-Sep-11 8:53
dcof2-Sep-11 8:53 
GeneralMessage Removed Pin
2-Sep-11 9:28
professionalN_tro_P2-Sep-11 9:28 
GeneralRe: C# code for windows Pin
dcof2-Sep-11 18:08
dcof2-Sep-11 18:08 
GeneralRe: C# code for windows Pin
Luc Pattyn2-Sep-11 14:09
sitebuilderLuc Pattyn2-Sep-11 14:09 
GeneralRe: C# code for windows Pin
dcof5-Sep-11 16:45
dcof5-Sep-11 16:45 

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.