Click here to Skip to main content
15,905,028 members
Home / Discussions / C#
   

C#

 
GeneralRe: Capturing Data from an Excel Spreadsheet Pin
JimmyMac9123-Nov-14 16:01
JimmyMac9123-Nov-14 16:01 
GeneralRe: Capturing Data from an Excel Spreadsheet Pin
Mycroft Holmes23-Nov-14 18:27
professionalMycroft Holmes23-Nov-14 18:27 
Questionrunning FTP Server Pin
Janis Heller23-Nov-14 8:52
Janis Heller23-Nov-14 8:52 
QuestionRe: running FTP Server Pin
PIEBALDconsult23-Nov-14 9:27
mvePIEBALDconsult23-Nov-14 9:27 
AnswerRe: running FTP Server Pin
Janis Heller23-Nov-14 9:45
Janis Heller23-Nov-14 9:45 
GeneralRe: running FTP Server Pin
Pete O'Hanlon23-Nov-14 20:51
mvePete O'Hanlon23-Nov-14 20:51 
QuestionObject reference not set to an instance of an object on passing reference variable to WPF Forms! Pin
EngrKhizarIqbal23-Nov-14 7:07
EngrKhizarIqbal23-Nov-14 7:07 
AnswerRe: Object reference not set to an instance of an object on passing reference variable to WPF Forms! Pin
Dave Kreskowiak23-Nov-14 7:33
mveDave Kreskowiak23-Nov-14 7:33 
AnswerRe: Object reference not set to an instance of an object on passing reference variable to WPF Forms! Pin
4a616e23-Nov-14 23:13
4a616e23-Nov-14 23:13 
GeneralRe: Object reference not set to an instance of an object on passing reference variable to WPF Forms! Pin
EngrKhizarIqbal24-Nov-14 7:51
EngrKhizarIqbal24-Nov-14 7:51 
Questionredirect webtraffic without writing rules to HOSTS file Pin
Janis Heller23-Nov-14 5:48
Janis Heller23-Nov-14 5:48 
AnswerRe: redirect webtraffic without writing rules to HOSTS file Pin
Dave Kreskowiak23-Nov-14 7:31
mveDave Kreskowiak23-Nov-14 7:31 
AnswerRe: redirect webtraffic without writing rules to HOSTS file Pin
Bernhard Hiller24-Nov-14 4:47
Bernhard Hiller24-Nov-14 4:47 
QuestionHow to retrive user name from Master Page control (Lable) and Display in aspx page using c# Pin
Member 785476923-Nov-14 4:24
Member 785476923-Nov-14 4:24 
AnswerRe: How to retrive user name from Master Page control (Lable) and Display in aspx page using c# Pin
OriginalGriff23-Nov-14 6:00
mveOriginalGriff23-Nov-14 6:00 
QuestionMenuStript Pin
Keypress23-Nov-14 3:10
Keypress23-Nov-14 3:10 
AnswerRe: MenuStript Pin
OriginalGriff23-Nov-14 3:42
mveOriginalGriff23-Nov-14 3:42 
GeneralRe: MenuStript Pin
Keypress23-Nov-14 3:47
Keypress23-Nov-14 3:47 
GeneralRe: MenuStript Pin
BillWoodruff23-Nov-14 3:50
professionalBillWoodruff23-Nov-14 3:50 
QuestionConverting Y up to Y down coordinates Pin
SledgeHammer0122-Nov-14 20:08
SledgeHammer0122-Nov-14 20:08 
AnswerRe: Converting Y up to Y down coordinates Pin
Richard MacCutchan22-Nov-14 22:25
mveRichard MacCutchan22-Nov-14 22:25 
GeneralRe: Converting Y up to Y down coordinates Pin
OriginalGriff22-Nov-14 22:53
mveOriginalGriff22-Nov-14 22:53 
GeneralRe: Converting Y up to Y down coordinates Pin
Richard MacCutchan22-Nov-14 23:11
mveRichard MacCutchan22-Nov-14 23:11 
GeneralRe: Converting Y up to Y down coordinates Pin
OriginalGriff22-Nov-14 23:15
mveOriginalGriff22-Nov-14 23:15 
GeneralRe: Converting Y up to Y down coordinates Pin
SledgeHammer0123-Nov-14 9:01
SledgeHammer0123-Nov-14 9:01 
Hmm... seems more like this is the correct answer:

C#
double Y = ((y + Math.Abs(dMin)) * (dHeight - 1)) / (dMax - dMin);
Y = dHeight - 1 - Y;


This works with:

C#
//lst.Add(-5);
lst.Add(0);
lst.Add(3);
lst.Add(7);
lst.Add(10);
//lst.Add(15);


With the commented and uncommented values.

dHeight = 30 (since the control is 30 pixels high, but the pixel range is 0 through 29)

With the original formula, the 0 would get to 29 correctly, but the 10 would only go to 1.72. With the -5 / 15 range, it would go to 0.43.

With this new formula, both ways got to 0 & 29.

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.