Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Developing a Keyboard component
 

Developing a Keyboard component

I've developed a little HTML keyboard for typing Greek in Unicode (<A href=http://dev.basictheology.com/greekkeyboard.aspx>http://dev.basictheology.com/greekkeyboard.aspx</a>) and I'd like convert this to a WindowForms app.  I don't really know where to start on drawing out the keyboard and creating dynamic buttons.  I understand how to code the underlying parts, but I'd appreciate some direction on the options to for how to "draw" out the keyboard.
MigrationUser 1  Tuesday, August 26, 2003 2:38 PM
I just created a 128 barcode control using the System.Drawing.Drawing2D namespace and was surprised out how easy it was. This coming from a graphically challenged programmer.

There are methods that allow you to create multiple rectangles and other shapes and draw them all at the same time.

For example, try the following code:    Private Sub Form2_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
        Dim g As Graphics = e.Graphics
        Dim oRects(2) As RectangleF
        Dim oBlackBrush As New SolidBrush(Color.Black)
        oRects(0) = New RectangleF(0, 0, 10, 100)
        oRects(1) = New RectangleF(20, 0, 10, 100)
        oRects(2) = New RectangleF(40, 0, 10, 100)
        g.FillRectangles(oBlackBrush, oRects)
    End SubFor me, this is exciting. My graphical skill isn't a heck of a lot more advanced than that but I can come up with some more examples if you like. On the other hand, maybe someone that posts in the <i>Game Development</i> or <i>Graphics and GDI+ in Windows Forms</i> would have some more advanced ideas.



Good luck!

MigrationUser 1  Thursday, August 28, 2003 9:58 PM
Thanks for the start. I can draw out the keys now, but now I need to figure out how to make them clickable as buttons or have mouseover properties and such. Any ideas.
MigrationUser 1  Tuesday, September 23, 2003 11:20 AM
Sure, using the example above, use the mouse click event and if the mouse click is within one of your pre-defined shapes, then initiate an action based on which shape it clicked in.
MigrationUser 1  Tuesday, September 23, 2003 1:34 PM
Hi, you say that make a barcode 128 control. Can you send me?
thanks
MigrationUser 1  Wednesday, November 12, 2003 9:03 PM

You can use google to search for other answers

Custom Search

More Threads

• VS2005 Form Designer not working
• Assign a Char* to Label
• Add controls by code in designersurface host?
• Generics and Localization in Designer Generated Code
• WinForms 2005 - "Ctrl" drag on a form design.
• displaying multiple forms in mdi
• Problem with designtime support for controls with collections
• Read the data from Datagrid view
• populating treeview control with directories - SLOW
• HowI can stop the BaseForm code execution in the Design-Time ??