Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to make this in C# [modified]

How to make this in C# [modified]

Scheduled Pinned Locked Moved C#
csharpcomtutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    duta
    wrote on last edited by
    #1

    Hi there I think everybody know about OnScreen Keyboard[^] from MS Windows(type osk in run). I wish to make that kind of application using C# but i have the following questions: 1) Those buttons are customs controls? 2) How to have just one function which triggers the pressed keys?

    modified on Thursday, October 30, 2008 5:50 AM

    L 1 Reply Last reply
    0
    • D duta

      Hi there I think everybody know about OnScreen Keyboard[^] from MS Windows(type osk in run). I wish to make that kind of application using C# but i have the following questions: 1) Those buttons are customs controls? 2) How to have just one function which triggers the pressed keys?

      modified on Thursday, October 30, 2008 5:50 AM

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Someone who is actually researching! That deserves some help :)

      duta wrote:

      1. Those buttons are customs controls?

      Those buttons won't be custom controls in the original program. However, Custom Controls would be an idea if you want to build something like that yourself. You could also use a "real" button, but those aren't flat.

      duta wrote:

      1. How to have just one function which triggers the pressed keys?

      Drag two buttons on the screen, and double-click on the OnClick handler of button1. This will create an event-handler for button1. Next, click once on the OnClick-handler of button2, and you'll get a list of events that have been built. Choose the event of button1. Both now point to the same event. You can also do this in code. First, create a general event-handler for the buttons;

          void button1\_Click(object sender, EventArgs e)
          {
              // Sender tells you what button has been pressed
          }
      

      In the load-event of your form, add some code to wire-up the events;

      this.button1.Click += new EventHandler(button1_Click);

      You can wire the second button to the same handler;

      this.button2.Click += new EventHandler(button1_Click);

      This way the Click-event of button2 will point to the eventhandler as declared for button1. Hope this helps :)

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups