EnableVisualStyles in 2003?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Peter

    #1

    EnableVisualStyles in 2003?

    Hello,

    I'm using Visual Studio 2003 and it would be nice if my buttons and other
    controls could look like Windows XP buttons rather than the flat square
    kind. I looked on the web and found some info on
    Application.Ena bleVisualStyles , but I'm not seeing much indication that 2003
    supports it. Does it? And if so, how does it work?

  • Branco Medeiros

    #2
    Re: EnableVisualSty les in 2003?

    Peter wrote:
    I'm using Visual Studio 2003 and it would be nice if my buttons and other
    controls could look like Windows XP buttons rather than the flat square
    kind. I looked on the web and found some info on
    Application.Ena bleVisualStyles , but I'm not seeing much indication that 2003
    supports it. Does it? And if so, how does it work?
    I'm not sure if this is supported in VS 2003. In VS 2005 (including
    the Express versions) you'd open the menu Project YourProjectName
    Properties and would check "Enable Xp visual styles" in the
    Application tab.

    As a last resource, you could go the manifest route (sigh):

    <link>

    </link>

    (beware of word wrap)

    HTH.

    Regards,

    Branco.

    Comment

    • Herfried K. Wagner [MVP]

      #3
      Re: EnableVisualSty les in 2003?

      "Peter" <starrim@hotmai l.comschrieb:
      I'm using Visual Studio 2003 and it would be nice if my buttons and other
      controls could look like Windows XP buttons rather than the flat square
      kind. I looked on the web and found some info on
      Application.Ena bleVisualStyles , but I'm not seeing much indication that
      2003 supports it. Does it? And if so, how does it work?
      Yes, it's supported. Adapt your 'Sub Main' to look similar to this one:

      \\\
      Public Sub Main()
      Application.Ena bleVisualStyles ()
      Application.DoE vents()
      Application.Run (New MainForm())
      End Sub
      ///

      Note that Windows XP visual styles must be enabled in Windows in order to
      see the difference.

      --
      M S Herfried K. Wagner
      M V P <URL:http://dotnet.mvps.org/>
      V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

      Comment

      • Mick Doherty

        #4
        Re: EnableVisualSty les in 2003?

        "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.atwrot e in message
        news:uExrI3$eHH A.4868@TK2MSFTN GP06.phx.gbl...
        >
        Yes, it's supported. Adapt your 'Sub Main' to look similar to this one:
        >
        \\\
        Public Sub Main()
        Application.Ena bleVisualStyles ()
        Application.DoE vents()
        Application.Run (New MainForm())
        End Sub
        ///
        ....and controls with a FlatStyle property must be set to FlatStyle.Syste m.

        For Buttons this means no Image, but you'll find sourcecode for a
        replacement Button on my site:


        --
        Mick Doherty
        Dotnetrix offers Nothing. Standard and Premium versions available.



        Comment

        • Peter

          #5
          Re: EnableVisualSty les in 2003?

          "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.atwrot e in message
          news:uExrI3$eHH A.4868@TK2MSFTN GP06.phx.gbl...
          "Peter" <starrim@hotmai l.comschrieb:
          >I'm using Visual Studio 2003 and it would be nice if my buttons and other
          >controls could look like Windows XP buttons rather than the flat square
          >kind. I looked on the web and found some info on
          >Application.En ableVisualStyle s, but I'm not seeing much indication that
          >2003 supports it. Does it? And if so, how does it work?
          >
          Yes, it's supported. Adapt your 'Sub Main' to look similar to this one:
          >
          \\\
          Public Sub Main()
          Application.Ena bleVisualStyles ()
          Application.DoE vents()
          Application.Run (New MainForm())
          End Sub
          Thanks for the tip... although that does not work for me. It says
          'EnableVisualSt yles is not a member of System.Windows. Forms.Applicati on.'

          Comment

          • Andrew Morton

            #6
            Re: EnableVisualSty les in 2003?

            Peter wrote:
            "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.atwrot e in message
            news:uExrI3$eHH A.4868@TK2MSFTN GP06.phx.gbl...
            >"Peter" <starrim@hotmai l.comschrieb:
            >>I'm using Visual Studio 2003 and it would be nice if my buttons and
            >>other controls could look like Windows XP buttons rather than the
            >>flat square kind. I looked on the web and found some info on
            >>Application.E nableVisualStyl es, but I'm not seeing much indication
            >>that 2003 supports it. Does it? And if so, how does it work?
            >>
            >Yes, it's supported. Adapt your 'Sub Main' to look similar to this
            >one: \\\
            >Public Sub Main()
            > Application.Ena bleVisualStyles ()
            > Application.DoE vents()
            > Application.Run (New MainForm())
            >End Sub
            >
            Thanks for the tip... although that does not work for me. It says
            'EnableVisualSt yles is not a member of
            System.Windows. Forms.Applicati on.'
            You're sure you're using VS2003 and not VS2002? According to the help
            (q.v.), System.Windows. Forms.Applicati on.EnableVisual Styles was introduced
            with .NET 1.1.

            Andrew


            Comment

            • Peter

              #7
              Re: EnableVisualSty les in 2003?

              "Andrew Morton" <akm@in-press.co.uk.inv alidwrote in message
              news:OlD4ADOfHH A.284@TK2MSFTNG P05.phx.gbl...
              Peter wrote:
              >"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.atwrot e in message
              >news:uExrI3$eH HA.4868@TK2MSFT NGP06.phx.gbl.. .
              >>"Peter" <starrim@hotmai l.comschrieb:
              >>>I'm using Visual Studio 2003 and it would be nice if my buttons and
              >>>other controls could look like Windows XP buttons rather than the
              >>>flat square kind. I looked on the web and found some info on
              >>>Application. EnableVisualSty les, but I'm not seeing much indication
              >>>that 2003 supports it. Does it? And if so, how does it work?
              >>>
              >>Yes, it's supported. Adapt your 'Sub Main' to look similar to this
              >>one: \\\
              >>Public Sub Main()
              >> Application.Ena bleVisualStyles ()
              >> Application.DoE vents()
              >> Application.Run (New MainForm())
              >>End Sub
              >>
              >Thanks for the tip... although that does not work for me. It says
              >'EnableVisualS tyles is not a member of
              >System.Windows .Forms.Applicat ion.'
              >
              You're sure you're using VS2003 and not VS2002? According to the help
              (q.v.), System.Windows. Forms.Applicati on.EnableVisual Styles was introduced
              with .NET 1.1.
              Well, by cracky, I thought I was using 2003. Guess it IS 2002. Don't I feel
              the perfect fool.

              Comment

              • Andrew Morton

                #8
                Re: EnableVisualSty les in 2003?

                Peter wrote:
                >You're sure you're using VS2003 and not VS2002? According to the help
                >(q.v.), System.Windows. Forms.Applicati on.EnableVisual Styles was
                >introduced with .NET 1.1.
                >
                Well, by cracky, I thought I was using 2003. Guess it IS 2002. Don't
                I feel the perfect fool.
                You've been working too hard... backup your computer and then have a few
                days off :-)

                Andrew


                Comment

                Working...