• 0

vb.net - use new scheme for controls


Question

14 answers to this question

Recommended Posts

  • 0

:o you have to use manifests for .net applications? :cry: i thought it was automatically built in :(

well how do i get the manifest inside the exe, i tried adding it to the project and it did nothing, but it works when it's in the same folder.

  • 0
  gameguy said:
this was made in vb.net, and none of my controls are showing up with the new looks.? the title bar and border is using luna, but nothing else is.? how do i get all my controls to use the luna look?

you also need to set all the controls that have a "Flatsyle" Property, to SYSTEM.

Edited by xStainDx
  • 0
  devgrp said:
In VS.NET 2003 just do this Application.EnableVisualStyles()

According to MSDN even if you type that new method you still need to set the controls flatstyle to system

Visual Basic] 
Imports System
Imports System.Drawing
Imports System.Windows.Forms

Namespace Snippet
 ? ?
 ' Summary description for Form1.
 ? ?Public Class Form1
 ? ? ? ?Inherits System.Windows.Forms.Form

 ? ? ? ?Private button1 As System.Windows.Forms.Button

 ? ? ? ?<System.STAThread()> _
 ? ? ? ?Public Shared Sub Main()

 ? ? ? ? ? ?System.Windows.Forms.Application.EnableVisualStyles()
 ? ? ? ? ? ?System.Windows.Forms.Application.Run(New Form1)
 ? ? ? ?End Sub 'Main

 ? ? ? ?Public Sub New()

 ? ? ? ? ? ?Me.button1 = New System.Windows.Forms.Button()
 ? ? ? ? ? ?Me.button1.Location = New System.Drawing.Point(24, 16)
 ? ? ? ? ? ?Me.button1.Size = New System.Drawing.Size(120, 100)
 ? ? ? ? ? Me.button1.FlatStyle = FlatStyle.System
 ? ? ? ? ? ?Me.button1.Text = "I am themed."

 ? ? ? ? ? ?' Sets up how the form should be displayed and adds the controls to the form.
 ? ? ? ? ? ?Me.ClientSize = New System.Drawing.Size(300, 286)
 ? ? ? ? ? ?Me.Controls.Add(Me.button1)

 ? ? ? ? ? ?Me.Text = "Application.EnableVisualStyles Example"
 ? ? ? ?End Sub[b]Me.button1.FlatStyle = FlatStyle.System[/b]espace 'Snippet

Shown in the code above: Me.button1.FlatStyle = FlatStyle.System

  • 0

thanks guys, but i'm using vs.net 2002 :( and the buttons are already set to system. i'll try a few things and post back the results.

btw, staind, i got it to work with the manifest, but i thought with .net you didn't need a manifest? :unsure:

  • 0
  gameguy said:
thanks guys, but i'm using vs.net 2002 :( and the buttons are already set to system. i'll try a few things and post back the results.

btw, staind, i got it to work with the manifest, but i thought with .net you didn't need a manifest? :unsure:

i use the manifest its the easiest, there is alternatives like coding it in manually depending on the windows version. :)

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

  • Recent Achievements

    • Week One Done
      SmileWorks Dental earned a badge
      Week One Done
    • Community Regular
      vZeroG went up a rank
      Community Regular
    • Collaborator
      Snake Doc earned a badge
      Collaborator
    • Week One Done
      Snake Doc earned a badge
      Week One Done
    • One Month Later
      Johnny Mrkvička earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      581
    2. 2
      ATLien_0
      200
    3. 3
      Michael Scrip
      199
    4. 4
      +FloatingFatMan
      129
    5. 5
      Xenon
      124
  • Tell a friend

    Love Neowin? Tell a friend!