wal_nut

I am using a MainMenu on a form, and it appears on the screen above the form, moving the vertical position of the form down, rather than appearing as on object on top of the form. In other words, the background color next to the MainMenu is gray, rather than the blue that I specified as the background color of the form.

Is there a way to fix this



Re: .NET Compact Framework MainMenu display relative to the form

Beerka

I really dont understand what is your question.

"rather than the blue that I specified"

Sometimes i also had problems with the designer.

Put this row into the forms constructor:

BackColor = Color.Blue;

after the InitializeComponent();





Re: .NET Compact Framework MainMenu display relative to the form

wal_nut

Thanks, but setting the background color of the form in its constructor did not work.

There is still a band of gray next to the mainmenu of the form





Re: .NET Compact Framework MainMenu display relative to the form

Beerka

Are u sure you set the color AFTER the initialization

If yes search for all references for the form's BackColor because you set it back somewhere else...





Re: .NET Compact Framework MainMenu display relative to the form

wal_nut

I am setting the backcolor AFTER the InitializeComponent.

I think the problem is that the MainMenu is almost displayed above the form rather than as part of the form. Because of the MainMenu, I actually had to shrink the height of the form from 240 to 220 so it fits on the screen.





Re: .NET Compact Framework MainMenu display relative to the form

Christopher Fairbairn

Hi,

wal_nut wrote:
I think the problem is that the MainMenu is almost displayed above the form rather than as part of the form.

Yes this is a correct assumption, the menu bar is a seperate control which will be placed above your form in the Z-order.

wal_nut wrote:
Because of the MainMenu, I actually had to shrink the height of the form from 240 to 220 so it fits on the screen.

Which platform are you developing on By the sounds of it (menu at top etc) I am guessing you are developing for a custom Windows CE device am I correct

Hope this helps,

Christopher Fairbairn






Re: .NET Compact Framework MainMenu display relative to the form

wal_nut

Yes, it is a custom Windows CE device



Re: .NET Compact Framework MainMenu display relative to the form

David Wrighton

There is no way to adjust the color of the background of a MainMenu on a custom CE device without causing the background of all windows to change color.

David Wrighton

.NET Compact Framework