Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
GeneralRe: implementation of "show me as idle for x mins" Pin
Kamran Zafar22-Nov-04 18:39
Kamran Zafar22-Nov-04 18:39 
GeneralDraw shape inside a control Pin
sreejith ss nair21-Nov-04 19:45
sreejith ss nair21-Nov-04 19:45 
GeneralRe: Draw shape inside a control Pin
DougW4821-Nov-04 20:32
DougW4821-Nov-04 20:32 
GeneralRe: Draw shape inside a control Pin
sreejith ss nair21-Nov-04 21:32
sreejith ss nair21-Nov-04 21:32 
QuestionDatagrid ??? Pin
npqk21-Nov-04 19:07
npqk21-Nov-04 19:07 
AnswerRe: Datagrid ??? Pin
sreejith ss nair21-Nov-04 19:50
sreejith ss nair21-Nov-04 19:50 
QuestionFont Height in twips? Pin
sachinkalse21-Nov-04 17:14
sachinkalse21-Nov-04 17:14 
AnswerRe: Font Height in twips? Pin
Nick Parker21-Nov-04 18:55
protectorNick Parker21-Nov-04 18:55 
Try the following:


[DllImport("gdi32.dll")]
static extern int GetDeviceCaps(IntPtr hdc, int nIndex);

int WU_LOGPIXELSX = 88;
int WU_LOGPIXELSY = 90;
int TwipsPerInch  = 1440;

private int PixelsToTwips(int pixels, bool bIsHorizonal)
{
    int twips;
    Graphics g = Graphics.FromHwnd(IntPtr.Zero);
    IntPtr hdc = g.GetHdc();
    int pixelsPerInch;
    if(bIsHorizonal)
        pixelsPerInch = GetDeviceCaps(hdc, WU_LOGPIXELSX);
    else
        pixelsPerInch = GetDeviceCaps(hdc, WU_LOGPIXELSY);
    g.ReleaseHdc(hdc);
    double numInches = pixels/pixelsPerInch;
    twips = (int)(numInches * TwipsPerInch);
    return twips;
}


- Nick Parker
My Blog | My Articles

GeneralRe: Font Height in twips? Pin
sachinkalse23-Nov-04 21:48
sachinkalse23-Nov-04 21:48 
GeneralResources in a Server application Pin
Jack Hui21-Nov-04 16:05
Jack Hui21-Nov-04 16:05 
GeneralCustom cursor + Imagelist Pin
DennisMetz21-Nov-04 13:14
DennisMetz21-Nov-04 13:14 
GeneralInteresting DB issue Pin
StephenMcAllister21-Nov-04 9:27
StephenMcAllister21-Nov-04 9:27 
GeneralRe: Interesting DB issue Pin
sreejith ss nair21-Nov-04 17:02
sreejith ss nair21-Nov-04 17:02 
GeneralLaunching C# Applications in IE Pin
mkushner21-Nov-04 5:27
mkushner21-Nov-04 5:27 
GeneralRe: Launching C# Applications in IE Pin
Dave Kreskowiak22-Nov-04 4:23
mveDave Kreskowiak22-Nov-04 4:23 
GeneralTab Key in the DataGrid Pin
Hamada_star21-Nov-04 3:53
Hamada_star21-Nov-04 3:53 
GeneralRe: Tab Key in the DataGrid Pin
Jay Shankar22-Nov-04 15:06
Jay Shankar22-Nov-04 15:06 
GeneralDataGrid RightToLeft Property Pin
Hamada_star21-Nov-04 3:45
Hamada_star21-Nov-04 3:45 
GeneralRe: DataGrid RightToLeft Property Pin
sreejith ss nair21-Nov-04 20:01
sreejith ss nair21-Nov-04 20:01 
GeneralDisposing resources used by MD5CryptoServiceProvider Pin
sillypuppy21-Nov-04 2:52
sillypuppy21-Nov-04 2:52 
GeneralPorting C++ struct to C# (BladeEnc.dll) Pin
Pr1v21-Nov-04 1:44
Pr1v21-Nov-04 1:44 
QuestionHow Can I Draw lines and text in DataGrid Header Pin
Hamada_star20-Nov-04 22:46
Hamada_star20-Nov-04 22:46 
AnswerRe: How Can I Draw lines and text in DataGrid Header Pin
sreejith ss nair21-Nov-04 16:59
sreejith ss nair21-Nov-04 16:59 
Generalprinting Pin
20-Nov-04 20:51
suss20-Nov-04 20:51 
GeneralRe: printing Pin
Luis Alonso Ramos20-Nov-04 21:26
Luis Alonso Ramos20-Nov-04 21:26 

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.