CF Newbie Questions.

S

SStory

I am new to the Compact Framework(CF).

I am doing my first CF app right now and have found some peculiar behavior,
and that the CF lacks a lot of what the framework has. For example, most
controls don't seem to have a background or border property.

I took care of that by drawing my own on somethings.

But a few things still puzzle me.

I have my form background property set to the default gray but it shows as
white on pocket pc 2002 emulator
1.) What do I need to do to control the background color?

2.) I am using a label control at the top and it won't let me put a border
around it, and it doesn't have a background color either. Is there no way
to do this? Do I have to drawstring to paint it there and paint the
background rect first?

3.) Are menus available on the Pocket PC and Windows CE? So that I can do
some menu options?

Thanks,

Shane
 
P

Pete Vickers [eMVP]

Hi,
1) Do it in runtime, e.g. me.backcolor = system.drawing.color.gray
The backcolor was fixed in SP2, but at runtime, not design time

2) For the border, in the form paint event, do something similar to
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
e.Graphics.DrawRectangle(New Pen(Color.Red), Label1.Left - 1,
Label1.Top - 1, Label1.Width + 1, Label1.Height + 1)
End Sub

3) Yes - mainmenu1 should appear as default when you create a form. Simply
click on it and you will see 'type here' at the bottom of the form. Enter
your menus there.


HTH

Pete
 
S

SStory

Thanks Pete


Pete Vickers said:
Hi,
1) Do it in runtime, e.g. me.backcolor = system.drawing.color.gray
The backcolor was fixed in SP2, but at runtime, not design time

2) For the border, in the form paint event, do something similar to
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As
System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
e.Graphics.DrawRectangle(New Pen(Color.Red), Label1.Left - 1,
Label1.Top - 1, Label1.Width + 1, Label1.Height + 1)
End Sub

3) Yes - mainmenu1 should appear as default when you create a form. Simply
click on it and you will see 'type here' at the bottom of the form. Enter
your menus there.


HTH

Pete
--
Pete Vickers
Microsoft Windows Embedded MVP
HP Business Partner
http://www.gui-innovations.com
 

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