Click here to Skip to main content
16,005,120 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: check box in VB6 Pin
kami9510-Oct-06 10:42
kami9510-Oct-06 10:42 
GeneralRe: check box in VB6 Pin
Kschuler10-Oct-06 10:52
Kschuler10-Oct-06 10:52 
AnswerRe: check box in VB6 Pin
bushliu10-Oct-06 16:47
bushliu10-Oct-06 16:47 
QuestionMicrosoft.Office.Interop.*.dll Pin
zenithmaximus9-Oct-06 22:01
zenithmaximus9-Oct-06 22:01 
Questiona huge Dataset? Pin
jlabrou_deleted9-Oct-06 21:15
jlabrou_deleted9-Oct-06 21:15 
AnswerRe: a huge Dataset? Pin
Colin Angus Mackay10-Oct-06 0:56
Colin Angus Mackay10-Oct-06 0:56 
QuestionHow to find width and height of font object? Pin
Krishnaraj Barvathaya B9-Oct-06 20:56
Krishnaraj Barvathaya B9-Oct-06 20:56 
AnswerRe: How to find width and height of font object? Pin
Dave Kreskowiak10-Oct-06 5:14
mveDave Kreskowiak10-Oct-06 5:14 
There is no real height and width of a font object, since most fonts are not monospaced, there is no real character cell you can use to estimate how wide your string is.

There's two ways to go about this. You actually have to use Graphics.MeasureString to get the dimensions of the drawn string to see how big it is in the supplied font. If it's too big, reduce the font size and try again. Keep doing so until the string fits.

Or, I've found a second method that works in limited cases, but it's MUCH quicker if performance is an issue. Instead of drawing the string the exact size you need it, draw it to an offscreen bitmap in a MUCH larger font size, like 96 points. Then draw the bitmap in the control you want, scaled up/down to the size you need. If done properly, it draws nicely, without all the jaggies you get when scaling an image.


Dave Kreskowiak
Microsoft MVP - Visual Basic


Questionform transperancy in vb Pin
suryapraba9-Oct-06 19:13
suryapraba9-Oct-06 19:13 
AnswerRe: form transperancy in vb Pin
Dave Kreskowiak10-Oct-06 5:00
mveDave Kreskowiak10-Oct-06 5:00 
QuestionDICOM image in picture box Pin
iamalik9-Oct-06 19:04
professionaliamalik9-Oct-06 19:04 
AnswerRe: DICOM image in picture box Pin
Dave Kreskowiak10-Oct-06 4:58
mveDave Kreskowiak10-Oct-06 4:58 
GeneralRe: DICOM image in picture box Pin
iamalik10-Oct-06 18:09
professionaliamalik10-Oct-06 18:09 
GeneralRe: DICOM image in picture box Pin
Dave Kreskowiak11-Oct-06 1:50
mveDave Kreskowiak11-Oct-06 1:50 
QuestionEmbedding Firefox Pin
UltraCoder9-Oct-06 18:10
UltraCoder9-Oct-06 18:10 
AnswerRe: Embedding Firefox Pin
Dave Kreskowiak10-Oct-06 4:56
mveDave Kreskowiak10-Oct-06 4:56 
QuestionProcessor Information Pin
UltraCoder9-Oct-06 18:06
UltraCoder9-Oct-06 18:06 
AnswerRe: Processor Information Pin
Dave Kreskowiak10-Oct-06 4:55
mveDave Kreskowiak10-Oct-06 4:55 
QuestionTable adapter help Pin
ranro20069-Oct-06 17:08
ranro20069-Oct-06 17:08 
AnswerRe: Table adapter help Pin
Colin Angus Mackay10-Oct-06 0:59
Colin Angus Mackay10-Oct-06 0:59 
QuestionRunning A Batch file in a windows service Pin
thedom29-Oct-06 14:24
thedom29-Oct-06 14:24 
AnswerRe: Running A Batch file in a windows service Pin
UltraCoder9-Oct-06 16:58
UltraCoder9-Oct-06 16:58 
GeneralRe: Running A Batch file in a windows service Pin
thedom29-Oct-06 17:08
thedom29-Oct-06 17:08 
AnswerRe: Running A Batch file in a windows service Pin
UltraCoder9-Oct-06 18:04
UltraCoder9-Oct-06 18:04 
GeneralRe: Running A Batch file in a windows service Pin
thedom29-Oct-06 19:02
thedom29-Oct-06 19:02 

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.