To close your application you can use this code snippet:
- Application.Current.Shutdown();
To close your application you can use this code snippet:
Today I had a problem closing a tab in the IDE: every time the IDE freezes.
The solution was to delete the *.suo file of the project group.
If you want to display the the drag handle in the lower right corner of the Window you have to set the ResizeMode Window property like that:
This is the result:
In my old Delphi developer days I used OutputDebugString() to track problems or elapsed time.
In .NET you can use the System.Diagnostics.Debug class.
You have to run the project in debug mode.
MSDN link: http://msdn.microsoft.com/en-us/library/6x31ezs1.aspx
To comment multiple lines please press STRG+K and STRG+C.
To uncomment multiple lines please press STRG+K and STRG+U.
If you got error message “Die Ressource “mainwindow.xaml” kann nicht gefunden werden.” or “Ressource “mainwindow.xaml” could not be found” compiling your project your MainWindow.xaml maybe moved to a subfolder. You have to adopt the path to the MainWindow.xaml in yor App.xaml.
<Application x:Class="Your.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="Views/MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>
Diese Meldung haut Ihnen der Compiler um die Ohren wenn Sie versuchen auf eine Instanz anstatt direkt auf den Typen bzw. class zuzugreifen.
Ein Beispiel:
public class MyClass
{
public static string MyConst = “My test const”;
}
Erzeugen einer Instanz:
MyClass _myclass= new MyClass();
Falscher Zugriffsversuch:
MessageBox(_myclass.MyConst);
Richtiger Zugriffsversuch:
MessageBox(MyClass.MyConst);
Um einen Zeilenumbruch zu erzeugen, der plattformunabhängig ist, steht dem Entwickler die Konstante Environment.NewLine zur Verfügung.
Beispiel: textBox1.Text += "Teststring" + Environment.NewLine;