VGA size - bug in CF?

H

Hilton

Hi,

MessageBox.Show (new TextBox ().Height.ToString());
MessageBox.Show (new ComboBox().Height.ToString());

gives 20 and 20 in non-VGA mode and 20 and 40 in VGA mode. Seems like the
CF does not set the height of textboxes correctly in VGA mode (using
res2exe). This means that textboxes are half-height, but combo boxes look
fine. Seems like "new TextBox" should create a 'usable' text box which is
doesn't.

A known bug?

Hilton
 
G

Guest

Comboboxes are sized in height by the font of the text they contain.
Textboxes are not. Since you're not setting any sizes, why would you expect
it to just "know" how big you want it?
 
H

Hilton

Chris,

I don't see the difference. Both have a font, both have (string.Empty)
text. Also, if your argument of not knowing how hight to make the textbox,
well, how come it gets it perfectly correct in the non-VGA enviroment?

Anyway, no biggee, just a few more lines of code etc, but just wierd and
unexpected ( to me at least).

Hilton
 
G

Guest

The difference is in how the native control works. The ComboBox you cannot
change the height of. The system bases its height ont he height of the font
being used. This means when one is created, the size is set by the OS.

A TextBox is different. It can have any size and it's unrelated to the
font. The managed control apparently has a default size of 20, but since
the control can be any size, there's no way for the CF to "know" how big
you're going to want it, therefore any default will be arbitrary so you
should set it to a desired size.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top