Announcement

Collapse
No announcement yet.

Manifestdatei?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Manifestdatei?

    Ich habe VS2005 und programmiere in C#.
    Im Designer sieht mein Formular modern aus, d.h. es werden die XP-Controls angezeigt.
    Starte ich mein Projekt aber, werden die alten Controls verwendet.
    Daraufhin habe ich mein Projektverzeichnis nach einer Manifestdatei durchsucht, jedoch keine gefunden.
    Wo oder wie kann ich VS2005 sagen, dass eine Manifestdatei angelegt werden soll?

  • #2
    Hallo,
    bei Visual Studio 2005 ist der alte Weg nicht mehr notwendig. Der <b>EnableVisualStyles</b>-Aufruf in <i>Programm.cs</i> regelt alles automatisch. Die EnableVisualStyles-Methode gab es bereits im .NET Framework 1.1, aber erst Visual Studio 2005 fügt diese in neu angelegten Projekten automatisch ein. Außerdem kann nun auch die <b>FlatStyle</b>-Eigenschaft der Controls auf dem Default-Wert (Standard) bleiben (im .NET Framework 1.1 muss neben EnableVisualStyles auch noch die FlatStyle-Eigenschaft <i>System</i> aktiviert werden).
    Normalerweise steht in einem neuen C#-Projekt in der Datei <i>Program.cs</i> der folgende Block:
    <pre>
    <div style="font-family: Courier New; font-size: 10pt; color: black; background: white; border-top: windowtext 1pt solid; padding-top: 0pt; border-left: windowtext 1pt solid; padding-left: 0pt; border-right: windowtext 1pt solid; padding-right: 0pt; border-bottom: windowtext 1pt solid; padding-bottom: 0pt;"><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; [<span style="color: teal;">STAThread</span>]</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: blue;">static</span> <span style="color: blue;">void</span> Main()</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: teal;">Application</span>.EnableVisualStyles();</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: teal;">Application</span>.SetCompatibleTextRenderingDefault(<span style="color: blue;">false</span>);</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color: teal;">Application</span>.Run(<span style="color: blue;">new</span> <span style="color: teal;">Form1</span>());</p><p style="margin: 0px;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }</p></div>
    </pre>
    &#10

    Comment

    Working...
    X