Friday, December 03, 2004

As you probably know that if you would want to implement a full “kiosk” mode on Pocket PC – which means that you need to hide the “Start” and SIP buttons to prevent users getting into underlying system. It’s easy to employ – just remove a MainMenu from a Form, set ControlBox to false and set the WindowState = FormWindowState.Maximized in the form’s Load event. But what if I still need clients to use SIP to enter some text? We could use the SipShowIM API, but this call will make the SIP button to appear again breaking the “kiosk” mode. So, to solve this puzzle I’ve created the SIPControl  - an owner-drawn control that allows creation of any type of SIP’s. Here’s the code snip that shows how to create a full SIP keyboard on your form:

sipFull = new SIPControl();

                 

// Location and size

sipFull.Location = new Point(1, 60);

sipFull.Size =    new Size(240, 90);

     

//Create ButtonRows

ButtonRow row1 = new ButtonRow(new string[]{"Q","W","E","R","T","Y","U","I","O","P"}, 1, 0);

row1.Space = 4;

// Add ButtonRow to the Rows collection

sipFull.Rows.Add(row1);

ButtonRow row2 = new ButtonRow( new string[]{"A","S","D","F","G","H","J","K","L"}, 10, 22);

row2.Space = 4;

sipFull.Rows.Add(row2);

ButtonRow row3 = new ButtonRow( new string[]{"Z","X","C","V","B","N","M"}, 30, 44);

row3.Space = 4;

sipFull.Rows.Add(row3);

ButtonRow row4 = new ButtonRow(  new string[]{"1","2","3","4","5","6","7","8","9","0"}, 1, 66);

row4.Space = 4;

sipFull.Rows.Add(row4);

                 

// Hook up the Click event

sipFull.ButtonClick+=new ButtonClickEventHandler(sipFull_ButtonClick);

this.Controls.Add(sipFull);        

 And here’s how the sample looks:

 

You can download the SIPControl and a sample from here.

SIPTest.zip (7.8 KB)
12/3/2004 4:44:53 PM (GMT Standard Time, UTC+00:00)  #     |