Re: Image Click

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: William Ryan eMVP (dotnetguru_at_comcast.nospam.net)
Date: 04/27/04


Date: Tue, 27 Apr 2004 09:52:44 -0400

Kamal:

In addition to Alex's post, you can wire in a click event for a Picture box,
so if you broke out the pictures of the buttons into seperate images, you
could put them on top of the background image and just handle the click
event directly. There are many controls that you can wire in a click event
for for instance and they'll compile, they just won't do anything. Witha
picturebox fortunately you can. You can also add the files as embedded
resources, set their build action to Embedded Resource, then reference them
directly in your project without having to worry about adding them to your
setup project. This may or may not be helpful depending on how you
implement it.

Anyway, to wire in an event, just go ahead and add it,
(assuming your picture was named picPlay:
this.picPlay.Click += new System.EventHandler(this.picPlay_Click);

write your handler:
private void picPlay_Click(object sender, System.EventArgs e)
  {
//Do something
}

And if you choose to referece embedded resources:

private Bitmap GetImage(ImageName i)
  {
   try
   {
    switch(i)
    {
     case ImageName.RecordDisabled:
      return new
Bitmap(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResource
Stream("MySolution.ResourceName.jpg"));
////the rest is just the closing parts of the top
HTH,

Bill

kamal" <kamal_28@rediffmail.com> wrote in message
news:FD4BBF48-A7D6-4B85-A548-D44FCF4BEFD5@microsoft.com...
> I am using a image(.jpg file) which contains the skin of a remote control.
> The idea is to develop an remote control application in my Pocket PC.
> Now I want the buttons in the image has to handle the click events. The
remote control image contains the ellipse and circle shaped buttons.
>
> Kindly help me by giving the idea to implement this.
>
> Thanks in advance.
>
> -kamal



Relevant Pages

  • Re: Sony KV J29 Green Lines
    ... to 45 sec for the picture to appear on the screen. ... Trace out the green video amp, try disconnecting the wire carrying the ... The sony technician said he would do ... One wire end is soldered to the H pin on ...
    (sci.electronics.repair)
  • Re: Nobody proposing new uk newsgroups - why ?
    ... >>>TCP 'ports' as seperate pieces of wire coming out the back of a machine. ... Nothing wrong with it as a picture. ... without multiplexing for something the complexity of a 1960s computer... ...
    (uk.net.news.config)
  • Re: Nobody proposing new uk newsgroups - why ?
    ... >>> I pictured TCP machines as having like a 'filter box' (maybe I thought ... >>'picture' about ports, and pipes, and other communications channels. ... pipes and bits of wire is as good as any. ... you can picture the 'inside of the box' in any way you ...
    (uk.net.news.config)
  • Re: Em tech help on flipper cowboy
    ... know what these are for.Sticker has long disappeared and wire colors ... is the one I'm not sure where it goes.My previous post had a picture ... of the hack and the switch blades in question.I have also found a big ... play unit and now I have no lightbox lights and the plays to play unit ...
    (rec.games.pinball)
  • Re: Core imbalance in RCDs
    ... >> to the core, see its response, start shaping it around the core, ... >> goes up gradually as the wire is shaped better and better around ... >> the toroid core, ... Picture 2, the effects on both sides cancel each other, zero result. ...
    (sci.electronics.design)