Textboxes becoming Labels - way confusing...

H

Hilton

Hi,

C#, CF 1, Smartphone (Blackjack):

I have successfully added textboxes, labels to various controls. Now for
some reason when I add text boxes on this one Control (defined as "Control
control"), the textboxes appear to change to labels. It is really wierd. I
was expecting to see 'boxes', but instead I saw nothing. Took me hours to
figure out that they were there, but with no text and no border, they
weren't visible.

So, I resorted to:

TextBox tb = new TextBox ();
tb.Text = "The Text box";
tb.Parent = this.control;
tb.Bounds = new Rectangle (0, 0, 250, 20);

and lo and behold, the appears a label! No border, not editable...

Anyone ever seen anything like this? BTW: The exact same code produces the
correct results on the desktop and the exact same EXE produces the correct
results when run on a Pocket PC; i.e. editable textboxes.

Weird...

Thanks,

Hilton
 
G

Guest

Hi

On Smartphones, Textboxes only have borders when they have the focus. That's
the way Microsoft has implemented it. Now if there is nothing in the
textbox, you cant see it (unless it gets the focus).
Thats why I always set a background color for textboxes, then you know that
they are really existing...

Sven
 
H

Hilton

Sven,

Thanks! I guess I couldn't see the forest for the trees. I tried the
BackColor and it works well.

Suggestion to Microsoft: How about giving non-focused textboxes a light gray
border?

Thanks,

Hilton
 

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