Menu disappears on Scrollbar using

  • Thread starter Thread starter Trollpower
  • Start date Start date
T

Trollpower

Greetings,

im working on WinCE 4.1. I have a scrollbar, which moves a Panel, if i
use the Scrollbar (only vertical). The Scrollbar appears if i click on
the InputPanel to let it appear. The problem here is, that as soon as
i use the scrollbar, the mainmenu disappears, somehow.

Doas anyone has this problem too and can tell me how to solve it?

Thanks in advance

Jens
 
Jens,

Can you clarify what you mean by the "InputPanel" control on your form ?

The InputPanel (or SIP) control is not supported for the Windows CE .NET
platform with the compact framework, and you'll get a NotSupportedException
if you add an InputPanel control to a form for Windows CE .NET.

I assume from your explanation that you're really referring to the Panel
control that you've placed on the form. Can you let me know what code
resides in the click event handler for the Scroll bar that you have
associated with the Panel control?

Thanks
Charlie Gifford
VS .NET for Devices IDE tester

This posting is provided "AS IS" with no warranties, and confers no rights.
 
Dear Charles,

yes, im using an InputPanel(that thing where you can make inputs, eg.
'a', '1' or 'RETURN'). I developed the Application for PPC2002 but have
to port it to WinCe 4.1 due to a change in the Device. So i tried to use
the "old" code.

What i did in detail: I have a form with a few TextBoxes in a Panel (not
an InputPanel :) ). If the InputPanel appears a scrollbar should also
appear to get to the invisible area covered by the InputPanel by
scrolling. If the scrollbar gets used, an event (ValueChanged) get
fired, where i move the Panel over the form, as described in some
Tutorials. Everything works fine until i move the scrollbar. If i click
on the InputPanel in the taskbar, the event to make the scrollbar
visible fires as expected. But if i move the scrollbar to get to the
covered areas the Mainmenu disappears somehow.

The following code shows what i did in the ValueChanged-Event of the
Scrollbar:

private void vScrollBar1_ValueChanged(object sender, System.EventArgs e)
{
this.panel.Top = 0 - this.vScrollBar1.Value;
}

"panel" is the Panel where the Textboxes resides.

I dont know why the InputPanel-Event works as the InputPanel-Object
itself does, but it works. I dont get any Exceptions on this.

I hope this can clarify the problem a little bit. Please let me know
what you think about it or how to solve the problem.

Just another small question: On PPC2002 the folowing line gives me the
size of the Desktop/Clientsize(width and height):
this.ClientSize.Width, this.ClientSize.Height

In WinCe i get the size of the whole desktop, which is in fact much
larger that the display. Do you know how to determine the visible area
of the desktop (display)?

Thank you very much for your afford.

Jens
 
Jens,

It looks like you'll need to calculate whether the panel's top property can
be adjusted up without running into the form area that is being occupied by
the menu control, and if it is, then don't scroll the form up anymore.

While clientsize can be used to get the form size for a PocketPC form, it
doesn't work for the Windows CE .NET platform, because the menu area is
part of the overall form or client area.

I had some luck using "this.Height - this.ClientSize.Height" to get the
height of the menu area, and then I compared the possible new value of
panel.top to this value (which would represent the very bottom of the
menu).

If the new panel.top value would end up being less than the lower border of
the menu area (and draw itself over the menu) then the scroll could be
"aborted".

I hope that this information / suggestion helps you out.

- Charles

This posting is provided "AS IS" with no warranties, and confers no rights.
 
Dear Charles,

thank you very much for your reply. First of all, is there a paper or
articel out there where the exact differences in .NET CF between
PPC2002/2003 and WinCe is described?

It makes sense to me, that if i move the Panel over the Menuarea the
Menu gets covered by it. So i put the Panel, which i want to move, into
another Panel. The result is, that if i move the "inner"-Panel over the
borders of the "outer"-Panel, its outside areas disappears. Now ive got
a nice scrolling-function with no further issues. Thanks for that. The
only thing about your explanation about the occupied space by the
menuarea is, that even if i scroll the Panel back to its origin
location, the Manu stays hidden. The scrolling doesnt abort on moving
into the menuarea. It works as normal, only the menu disappears. Strange
that...

As for the problem with the ClientSize i solved the problem by assigning
a fixed size to each form. So the this.Height-property works for me.

Thank you very much again for your nice help :)

Greetings

Jens
 
Back
Top