Click here to Skip to main content
15,920,030 members
Home / Discussions / C#
   

C#

 
Generalupdating label in main form Pin
Jason Ranin5-Jul-04 4:16
Jason Ranin5-Jul-04 4:16 
GeneralRe: updating label in main form Pin
exhaulted5-Jul-04 4:24
exhaulted5-Jul-04 4:24 
GeneralReading TOC and text from Word 2002 Pin
Steven_T5-Jul-04 2:34
Steven_T5-Jul-04 2:34 
QuestionHow to add custom properties in PropertyGrid at Runtime Pin
ilmian5-Jul-04 1:34
ilmian5-Jul-04 1:34 
Questionhow to get my computer speed Pin
maro-gb5-Jul-04 1:10
maro-gb5-Jul-04 1:10 
AnswerRe: how to get my computer speed Pin
Heath Stewart5-Jul-04 5:29
protectorHeath Stewart5-Jul-04 5:29 
Generalgenerics Pin
noraguta5-Jul-04 0:21
noraguta5-Jul-04 0:21 
GeneralRe: generics Pin
noraguta5-Jul-04 1:52
noraguta5-Jul-04 1:52 
Questionhow to make a customized control box Pin
Imran Ahmed Khan5-Jul-04 0:11
Imran Ahmed Khan5-Jul-04 0:11 
AnswerRe: how to make a customized control box Pin
Heath Stewart5-Jul-04 5:17
protectorHeath Stewart5-Jul-04 5:17 
GeneralPrinting Pin
exhaulted5-Jul-04 0:06
exhaulted5-Jul-04 0:06 
GeneralRe: Printing Pin
exhaulted5-Jul-04 0:21
exhaulted5-Jul-04 0:21 
GeneralConverting Pixels to 100/Inch Pin
exhaulted5-Jul-04 0:59
exhaulted5-Jul-04 0:59 
GeneralRe: Converting Pixels to 100/Inch Pin
Pain_Elemental5-Jul-04 2:19
Pain_Elemental5-Jul-04 2:19 
GeneralRe: Converting Pixels to 100/Inch Pin
Pain_Elemental5-Jul-04 3:53
Pain_Elemental5-Jul-04 3:53 
GeneralRe: Converting Pixels to 100/Inch Pin
exhaulted5-Jul-04 4:21
exhaulted5-Jul-04 4:21 
GeneralRe: Converting Pixels to 100/Inch Pin
Heath Stewart5-Jul-04 5:38
protectorHeath Stewart5-Jul-04 5:38 
The correct way is to P/Invoke GetDeviceCaps and query for the logical pixels / physical pixels using LOGPIXELSX and LOGPIXELSY. Hard-coding numbers like the other guy did will not work on every system, especially these days when more and more displays are moving to 120 DPI as opposed to the currently common 96 DPI.

I've posted code to correctly get the number of pixels per some physical unit (twips, actually, which is 1/1440 of an inch) before. See an example at http://www.codeproject.com/script/comments/forums.asp?msg=829941&forumid=1649#xx829941xx[^].

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: Converting Pixels to 100/Inch Pin
exhaulted5-Jul-04 6:06
exhaulted5-Jul-04 6:06 
GeneralRe: Converting Pixels to 100/Inch Pin
Heath Stewart5-Jul-04 6:27
protectorHeath Stewart5-Jul-04 6:27 
GeneralRe: Converting Pixels to 100/Inch Pin
exhaulted5-Jul-04 23:50
exhaulted5-Jul-04 23:50 
GeneralRe: Converting Pixels to 100/Inch Pin
Heath Stewart6-Jul-04 4:21
protectorHeath Stewart6-Jul-04 4:21 
GeneralRay Picking Pin
ghho5-Jul-04 0:04
ghho5-Jul-04 0:04 
Generalenum and inheritance Pin
Anonymous4-Jul-04 23:39
Anonymous4-Jul-04 23:39 
GeneralRe: enum and inheritance Pin
hatim_ali5-Jul-04 2:12
hatim_ali5-Jul-04 2:12 
GeneralRe: enum and inheritance Pin
Anonymous5-Jul-04 3:50
Anonymous5-Jul-04 3:50 

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.