You can simplify the following VB.NET code snippet by using NOT instead of IIF
- DeleteButton.IsEnabled = IIf(DeleteButton.IsEnabled = True, False, True)
can be restated in a simplified syntax as
- DeleteButton.IsEnabled = Not DeleteButton.IsEnabled
You can simplify the following VB.NET code snippet by using NOT instead of IIF
can be restated in a simplified syntax as
I created a UserControl called: “StatusBarControl” and it has a StatusBar contol with the following contols: UserNameTextBlock, a Lable for reporting progress, a ComboBox for displaying Styles of the form so the user can change them using the my.settings.UserStyle string, and a StatusBar for showing progress.
You first have to put in the header of the XAML Window the Following
In order to use a local UserControl you have to define the NameSpace of the Project that the Control resides in.
xmls:local=”clr-namespace:MyProjectWPF_GUI
Next you create the UserControl as a UserControl in your project. My UserContol is called “StatusBarControl”. Then you assign it its local name.
<local:StatusBarControl x:Name=”StatusBarControl… />
It reference the UserControl File called “StatusBarControl.xaml” under a directory “UserControls” in the Project “MyProjectWPF_GUI”
To update/refresj the “StatusBarControl” you will need the Application.DoEvents that is in the System.Windows.Forms NameSpace… System.Windows.Forms.Application.DoEvents()
That is it. If you have any Questions, please leave me a comment.