locked
Require TabPage Control for WM 5.0 SmartPhone Application RRS feed

  • Question

  •  

    Hi,

    As there is no TabPage Control available for WM 5.0 SmartPhones Application,But i want this.........

    Anybody having any idea.......how i can get this

    any sample code is welcome

     

     

    Thanx

    ----------------------------

    Neha

    Wednesday, September 26, 2007 12:26 PM

Answers

  • Hi,

     

     Neha Goyal wrote:
    I already evaluated the usability of tab control and user can select a new tab by the right & left nevigation keys.

     

    If you have evaluated the usability then I guess it may work in your situation.

     

    I would have reservations on using right/left keys however, especially if you needed to use textbox or combobox style controls etc (which already use those key combinations).

     

     Neha Goyal wrote:
    You said that..... the Pocket PC style tab control is accessible via native Win32 code it serves little point.

    Can u tell me how this is possible.....

    Any sample code or referred link is most welcome.......

     

    I have quickly knocked together a small demo. The application shows how to access the Tab control (which is part of the native Win32 Common Controls) from a Compact Framework application targeting a Smartphone.

     

    You can download it from my blog via the following URL - http://www.christec.co.nz/blog/wp-content/uploads/2007/09/smartphonetabcontrol.zip

     

    The main form has two panels, both with their Dock property set to DockStyle.Fill. One panel contains a couple of labels, while the second contains an image.

     

    A tab control at the bottom of the form has two tabs labeled "First" and "Second" which visually represent which panel is currently visible.

     

    A KeyUp event handler on the form, changes the panel visibility (and currently selected tab index) as the Left and Right keys are pressed.

     

    If you get an error message when attemptign to open the form in the Form Designer, try compiling the project first and re-opening the form (it needs the custom control to be compiled before it is viewable).

     

    Hope this helps,

    Christopher Fairbairn

     

    PS: As with an sample code, it's not suitable for production use. If you are keen in using this code, you would need to improve upon it to make the SmartphoneTab control more robust etc.

    Friday, September 28, 2007 12:01 AM

All replies

  •  

    Hi,

     

    As there is no tab page control available for WM 5.0 SmartPhones Application ,But i want this control.........

    Anybody having any idea......

     

     

    Thanx

    -------------

    Neha

    Wednesday, September 26, 2007 12:22 PM
  • That control is not available on SP per design guidelines as there's no good way to use it without touch screens only using arrow buttons. Consider using multiple forms instead.

    Wednesday, September 26, 2007 5:22 PM
  • Hi,

     

     Neha Goyal wrote:
    As there is no tab page control available for WM 5.0 SmartPhones Application ,But i want this control.........

     

    There is no standard support for this control. Within the Compact Framework it simply isn't exposed, and although the Pocket PC style tab control is accessible via native Win32 code it serves little point, because the control is not intended for use on this platform and has not been extended with any keyboard navigation capability etc.

     

    Your best bet probably would be to simulate this style of user interface via some other mechanism such as a custom control. However you should evaluate the usability of such an interface before going too far down this track (how would the user select a new tab for instance?)

     

    A more "smartphone" style user interface would be to perhaps to have multiple forms, with a common menu attached to the soft-key menu bar at the bottom of the smartphone's screen which allows the user to switch between them. Hence the popup menu emulates the tabs of a tab page.

     

    The settings application of a smartphone also shows another alternative way to represent a similiar UI. In this case, the settings application uses a listview control to display the names of a list of "tabs". Using the DPAD keys etc you can select one which then launches a new form, when the user leaves the form they return to the list of "tabs".

     

    Hope this helps,

    Christopher Fairbairn

    Thursday, September 27, 2007 3:10 AM
  • Hi Christopher,

     

    Thanx for reply....

     

    I already evaluated the usability of tab control and user can select a new tab by the right & left nevigation keys.

    I saw the setting application........but i want all the pages should be in the form of tab control.

    I also tried to create the custom control.........but didn't get the same control

     

    You said that..... the Pocket PC style tab control is accessible via native Win32 code it serves little point.

    Can u tell me how this is possible.....

    Any sample code or referred link is most welcome.......

     

     

    Thaxs

    ------------------------

    Neha Goyal

    Thursday, September 27, 2007 5:59 AM
  • Hi,

     

     Neha Goyal wrote:
    I already evaluated the usability of tab control and user can select a new tab by the right & left nevigation keys.

     

    If you have evaluated the usability then I guess it may work in your situation.

     

    I would have reservations on using right/left keys however, especially if you needed to use textbox or combobox style controls etc (which already use those key combinations).

     

     Neha Goyal wrote:
    You said that..... the Pocket PC style tab control is accessible via native Win32 code it serves little point.

    Can u tell me how this is possible.....

    Any sample code or referred link is most welcome.......

     

    I have quickly knocked together a small demo. The application shows how to access the Tab control (which is part of the native Win32 Common Controls) from a Compact Framework application targeting a Smartphone.

     

    You can download it from my blog via the following URL - http://www.christec.co.nz/blog/wp-content/uploads/2007/09/smartphonetabcontrol.zip

     

    The main form has two panels, both with their Dock property set to DockStyle.Fill. One panel contains a couple of labels, while the second contains an image.

     

    A tab control at the bottom of the form has two tabs labeled "First" and "Second" which visually represent which panel is currently visible.

     

    A KeyUp event handler on the form, changes the panel visibility (and currently selected tab index) as the Left and Right keys are pressed.

     

    If you get an error message when attemptign to open the form in the Form Designer, try compiling the project first and re-opening the form (it needs the custom control to be compiled before it is viewable).

     

    Hope this helps,

    Christopher Fairbairn

     

    PS: As with an sample code, it's not suitable for production use. If you are keen in using this code, you would need to improve upon it to make the SmartphoneTab control more robust etc.

    Friday, September 28, 2007 12:01 AM
  • Hi Christopher,

     

    Thaxs alot.........

    You really solve out my problem.The TabControl is simply working great.

    But i want to ask some more questions:

    1)  can i have TabPages(same as windows TabControl) corresponding to each tab?

    2)  Can i add image on a tab rather then the Text(in AddTab(int index,Image Imagepic).........)

     

    If above things are possible..................then please suggest me the answers.

     

    Thaxs again

     

    -------------------------------

    Neha Goyal

    Friday, September 28, 2007 7:51 AM
  • Hi Neha Goyal,

     

     Neha Goyal wrote:

    But i want to ask some more questions:

    1)  can i have TabPages(same as windows TabControl) corresponding to each tab?

    2)  Can i add image on a tab rather then the Text(in AddTab(int index,Image Imagepic).........)

     

    Take a look at my latest blog entry on my blog - "Creating a Tab Control for the Smartphone" - http://www.christec.co.nz/blog/archives/136

     

    I have taken the sample I referenced previously and extended it slightly.

     

    This "custom" tab control supports both Pocket PC and Smartphone devices. The tabs can now have optional images displayed on them, and the control exposes SelectedIndexChanged and SelectedIndexChanging events which allow your application to respond to changes in the tab selection.

     

    I have also added a third tab to the sample project with a couple of textboxes on it. Using the DPAD to scroll up and down will tab through the textboxes, once the select the TAB control, you can then press left/right on the DPAD to switch between tabs etc.

     

    Unfourtantly I havn't had any time to work on the design time experience for this control, meaning this control is not quite as easy to work with as the standard TabControl. This is kind of left as an exercise to any interested party. My original intention was to demonstrate one possible approach to obtaining a tab control on a smartphone device, and I think this sample application demonstrates that this technique is feasible.

     

    Since this control is dynamically changing the visibility of a couple of docked panels to simulate TabPages, you may like to use the "Document Outline" window accessable via the "View" menu within Visual Studio, if you have not came across this window before. I find this window very helpful when dealing with multiple panels all docked on top of each other, since you can drag a panel to the top of the Z-order even if you can't physically see it at present...

     

    Hope this helps,

    Christopher Fairbairn

    Saturday, September 29, 2007 12:52 PM
  • Hi Christopher,

     

    Thanx for the great work you did for me...........

    The Tab Control is simply working great and the changes that you made in this are same as i required.

     

    Thaxs Alot

    ---------------------------

    Neha Goyal

    Monday, October 1, 2007 11:00 AM