Panel & click event

  • Thread starter Thread starter Emss
  • Start date Start date
E

Emss

Hello,

I'm discovering CF 2.0 & C# development and I'm trying to create an
application for my Orange SPV-M3000 (WM5).

I need to group labels on a panel and make this panel react to clicks/taps.

I thought about creating a button that would cover the whole panel area
and change the background color of the button to transparent, but from
the archives of this group, it seems that CF doesn't support control
transparency.

Is there any other way to achieve my goal or do I have to create a
custom control (I've never done this kind of work) ?

Thanks for any advice, regards.

Eric Masson
 
Chris Oswald a écrit :

Hi,
Perhaps you could provide some more details about what you are trying
to do.

I'm trying to create rectangular areas that contain labels, graphics and
so on (GPS data), on the pda screen.

I'd like that these areas react to a click/tap by issuing a click event
that could be handled the standard way in C# (Eventhandler).

The nearest thing I can think of is a button whose content would look
like a full featured panel (container of labels, graphics, with custom
layout) and not only a text.

As I'm not a skilled C# CF programmer, I'd like to keep the whole thing
simple stupid ;)

Regards
 
Emss,

If you were just doing text you could use a panel. You could put the
labels on the panel and handle the click event of the panel. Clicking
on the labels will raise the click event of the panel. If you use a
picture box for the graphics you can handle the click event for it.

Does this help?

If not give me some an example of what your user would do. As in the
user will click on the latitude label and this will popup a message
box.....
 
Chris Oswald a écrit :

Hi Chris,
If you were just doing text you could use a panel. You could put the
labels on the panel and handle the click event of the panel.

I've tried to do this with the designer in VS2005. When I did try, I
double clicked on one of the panels and the result was a new method in
the code with the following signature :
private void panel_GotFocus(object sender, EventArgs e) {}

I've just typed code manually in the code window and it works :
panel.Click +=new EventHandler(panel_click);
Clicking on the labels will raise the click event of the panel.
If you use a picture box for the graphics you can handle the click
event for it.
Ok.

Does this help?

Yes, it helps a lot, it seems, I relied way too much on the visual
designer...
If not give me some an example of what your user would do. As in the
user will click on the latitude label and this will popup a message
box.....

For example, a click on the panel displaying distance information should
reset the data displayed by labels, a click on the panel displaying
position should toggle storing of successive coordinates in a file and
so on.

Thanks a lot for your help.

Regards

Eric
 
Back
Top