Click here to Skip to main content
16,006,348 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Replace-Funktion for controlcollection Pin
Alan Burkhart28-Apr-09 18:46
Alan Burkhart28-Apr-09 18:46 
QuestionInserting into a link table when inserting using a grid Pin
Ekjon28-Apr-09 6:59
Ekjon28-Apr-09 6:59 
AnswerRe: Inserting into a link table when inserting using a grid Pin
Ekjon28-Apr-09 8:05
Ekjon28-Apr-09 8:05 
QuestionDataGridView - Date column [Get Input format dd/MM/yyyy] Pin
Paramu197328-Apr-09 6:39
Paramu197328-Apr-09 6:39 
AnswerRe: DataGridView - Date column [Get Input format dd/MM/yyyy] Pin
Mycroft Holmes28-Apr-09 15:57
professionalMycroft Holmes28-Apr-09 15:57 
QuestionResize text to fill textbox? Pin
Garfunkiel28-Apr-09 6:34
Garfunkiel28-Apr-09 6:34 
AnswerRe: Resize text to fill textbox? Pin
Dave Kreskowiak28-Apr-09 6:53
mveDave Kreskowiak28-Apr-09 6:53 
AnswerRe: Resize text to fill textbox? Pin
Luc Pattyn28-Apr-09 6:55
sitebuilderLuc Pattyn28-Apr-09 6:55 
Hi,

this is what I would try:

0.
choose fontsize fs1=10;

1.
use Graphics.MeasureString() with some font (fontsize fs1), the right width, and let it compute the height that would take. Make sure to give it all parameters equal to what you will use in the TextBox eventually.

2.
calculate a new fontsize as fs1 = fs1 * 0.9 * textboxHeight/measureStringHeight; (use floating-point!)

3.
since with a different font size word wrapping will be different too, iterate steps 1 and 2 say three times. (The 0.9 factor above is there to reduce the likelihood final text does overflow just a bit)

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

Avoiding unwanted divs (as in "articles needing approval") with the help of this FireFox add-in


QuestionHow to implement UNDO/REDO in vb.net windows Pin
dilipmca0428-Apr-09 5:06
dilipmca0428-Apr-09 5:06 
AnswerRe: How to implement UNDO/REDO in vb.net windows Pin
Henry Minute28-Apr-09 5:14
Henry Minute28-Apr-09 5:14 
AnswerRe: How to implement UNDO/REDO in vb.net windows Pin
0x3c028-Apr-09 5:45
0x3c028-Apr-09 5:45 
AnswerRe: How to implement UNDO/REDO in vb.net windows Pin
Dave Kreskowiak28-Apr-09 6:48
mveDave Kreskowiak28-Apr-09 6:48 
QuestionX - Key as a shortcut creates problem when typing. Pin
Atul Kharecha28-Apr-09 2:38
Atul Kharecha28-Apr-09 2:38 
AnswerRe: X - Key as a shortcut creates problem when typing. Pin
Jay Royall28-Apr-09 2:44
Jay Royall28-Apr-09 2:44 
GeneralRe: X - Key as a shortcut creates problem when typing. Pin
Atul Kharecha28-Apr-09 2:51
Atul Kharecha28-Apr-09 2:51 
GeneralRe: X - Key as a shortcut creates problem when typing. Pin
Jay Royall28-Apr-09 2:58
Jay Royall28-Apr-09 2:58 
AnswerRe: X - Key as a shortcut creates problem when typing. Pin
Tom Deketelaere28-Apr-09 2:46
professionalTom Deketelaere28-Apr-09 2:46 
GeneralRe: X - Key as a shortcut creates problem when typing. Pin
Atul Kharecha28-Apr-09 3:58
Atul Kharecha28-Apr-09 3:58 
GeneralRe: X - Key as a shortcut creates problem when typing. Pin
Luc Pattyn28-Apr-09 4:05
sitebuilderLuc Pattyn28-Apr-09 4:05 
GeneralRe: X - Key as a shortcut creates problem when typing. Pin
Tom Deketelaere28-Apr-09 4:16
professionalTom Deketelaere28-Apr-09 4:16 
QuestionCropping a High Resolution Image in VB.Net 2008 Pin
wkitlam28-Apr-09 1:22
wkitlam28-Apr-09 1:22 
AnswerRe: Cropping a High Resolution Image in VB.Net 2008 Pin
Luc Pattyn28-Apr-09 1:27
sitebuilderLuc Pattyn28-Apr-09 1:27 
GeneralRe: Cropping a High Resolution Image in VB.Net 2008 Pin
wkitlam29-Apr-09 22:37
wkitlam29-Apr-09 22:37 
GeneralRe: Cropping a High Resolution Image in VB.Net 2008 Pin
Luc Pattyn30-Apr-09 0:56
sitebuilderLuc Pattyn30-Apr-09 0:56 
AnswerRe: Cropping a High Resolution Image in VB.Net 2008 Pin
Henry Minute28-Apr-09 2:14
Henry Minute28-Apr-09 2:14 

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.