Control style in Basic4ppc

Discussion in 'Questions (Windows Mobile)' started by ExcludeReality, May 11, 2009.

  1. ExcludeReality

    ExcludeReality Active Member Licensed User

    I use Basic4ppc mostly to create desktop applications, and there is something that's always been annoying me.
    All the controls on desktop have the visual style of Windows 2000 (Or some other early windows-version).

    When you run an application on a phone the control style changes to the Windows-mobile style.
    Why doesen't the same thing happend with Vista?
     
  2. Pachuquin

    Pachuquin Member Licensed User

  3. Cableguy

    Cableguy Expert Licensed User

    I believe your apps use native B4p Form...
    Try to use a FormEx control, from Agraham's dll, and you'll seem the diference..
     
  4. ExcludeReality

    ExcludeReality Active Member Licensed User

    None of the suggestions worked.
    The manifest thing didn't do anything at all.
    Cableguy, I do not fully understand how to add a control from the FormExDesktop library.
    Don't you mean ControlExDesktop?
    :sign0085:
     
  5. Pachuquin

    Pachuquin Member Licensed User

    I think that you have not understand it well.

    Try this utility to create the manifest file easier.


    XP Look 1.0

    You have to select your exe file and the utility will create the manifest file.
     
  6. ExcludeReality

    ExcludeReality Active Member Licensed User

    First of all I'm using Vista. Consequently I fail to see why I should make an XP manifest file.
    And also, I wanted an answer from someone who could tell me why Basic4ppc doesn't adjust the style of basic controls (Buttons, Combo boxes, Check boxes...) depending on how thoose controls should look like!
     
  7. agraham

    agraham Expert Licensed User

    Getting shirty when people are trying to help is not a good idea. :(

    You DO need a manifest file, there are other options if you have Visual Studio or the SDK but manifests are easiest.

    Most controls adapt automatically but you also need to use the Door library to set the FlatStyle property of Buttons, CheckBoxes And RadioButtons to "System" to get them drawn according to a theme.
     

    Attached Files:

    Last edited: May 14, 2009
  8. ExcludeReality

    ExcludeReality Active Member Licensed User

    It works! Thank you so much Agraham and Pachuquin! :sign0060:
    I didn't even think it was possible.

    And :sign0013: if i was disrespectful
     
  9. agraham

    agraham Expert Licensed User

    A bit of research later and using the Door library I got it to work without a manifest file. :) This works on .NET 2.0 and later.

    EDIT:- Note that on .NET 2.0 Buttons, CheckBoxes and RadioButtons no longer need their FlatStyle properties altered to support visual styles. I have amended the attachment accordingly
     

    Attached Files:

    Last edited: May 14, 2009
  10. taximania

    taximania Well-Known Member Licensed User

    For desktop applications :sign0060:

    You impress me again AGraham :icon_clap:
     
  11. Zenerdiode

    Zenerdiode Active Member Licensed User

    ...and these four lines of code are burned into all of my desktop applications. :sign0060:

    Will it throw an exception if this is run on a Windows 2000 platform?

    Interestingly, when run in the IDE, the IDE itself adopts the Windows XP style.
     

    Attached Files:

  12. agraham

    agraham Expert Licensed User

    I don''t know, probably not as it is a .NET Framework facility which I would hope would find out if the the OS supported visual styles and fail gracefully if not. You could always ErrorLabel it to make sure.

    Code:
    Sub SetAppStyle
      ErrorLabel(StyleErr)
      obj1.New1(
    False)
      obj1.CreateNew(
    "System.Windows.Forms.Application" & obj1.System_Windows_Forms)
      obj1.RunMethod(
    "EnableVisualStyles")
      obj1.SetProperty(
    "VisualStyleState""ClientAndNonClientAreasEnabled")
    StyleErr:
    End Sub
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice