This one is all over the web. Just thought I’d post it here in case you haven’t see it. It sums it up pretty well.
All about GUI's, WPF and Silverlight
This one is all over the web. Just thought I’d post it here in case you haven’t see it. It sums it up pretty well.
To change the font size of the tab header of a wpf tab control you have to redefine the ItemTemplate property of the Tab Control.
This is a question I have heard a lot, so I decided to blog about it for those of you needing to do the same thing. Here is a code sample.
<DataTemplate x:Key=”temp”>
<TextBlock Text=”{Binding}” FontSize=”20”/>
</DataTemplate>
<TabControl …. ItemTemplate=”{DynamicResource temp}”/>
That’s all there is to it.
Happy Coding!
I often use a remote desktop connection to work on my desktop from my laptop. This is very handy, but there are some limitations. One such limitation is the lack of ability to reboot the machine you are remoting into. The option is not available within the start menu when you are remoting. There are some instances, though, when you really need to reboot. If you find yourself in this situation, you can reboot via the command line. Here is the command to do it.
shutdown /r /t 01
Happy Remoting!
I have posted on this topic before, but I thought I would re-post with a step by step tutorial for those who are very new to wpf. Sorry to those of you who are more veterans. I will post more advanced topics soon, but this one’s for the newbies.
Here goes…
WPF makes creating a splash screen fairly simple. All you need to do is embed an image file into your project and change the Build Action on it.
Here is a step-by-step tutorial on how to do this.
Step 1) Create your application.
Here is the xaml for my very complicated application:
Step 2) Add an image file to your application. PNG files with transparent backgrounds are supported and are often a good choice for splash screens. Here is the image I created in Photoshop… nice huh?
Step 3) Right click on the image file in the solution explorer and click on Properties
Step 4) Set the Build Action to SplashScreen in the Properties panel
Step 5) Build and run the application.
You should now see your image splash before the application is loaded. I managed to get a screenshot as the splash screen was fading out and my application was starting to fade in.
That’s all there is to it. It is very simple. There are other ways to show and hide your splashcreen in code, but I won’t get into that in this post. I just wanted to keep it simple for those of you new to SplashScreens in wpf. Happy Splash Screening!
Just ran into another strange wpf bug. This one involves checkboxes and radiobuttons. I was working on a login screen that has a couple of checkboxes for remembering the username and password. The code looked like this…
<StackPanel HorizontalAlignment="Left" Orientation="Horizontal">These checboxes were on a dark colored panel, so the white text showed up nicely. Running the app on my Windows 7 box worked fine, but when I ran the app on a Windows XP box, you could not see the check mark inside the box when the user clicked on it. The control still worked, but the check was just invisible. Actually, it wasn’t invisible, it was just a white checkmark on a white box (aka… invisible). This is a wpf/windows xp/checkbox bug. In Windows XP, when the foreground color is changed, the checkmark picks up that color change… why? you ask?… I don’t know. But, here is a workaround for this situation. Simply put labels with the white foreground as the content for your checkboxes. Now the foreground color of the checkbox is still the default (black) color and the checkmark will be visible for those running the app in Windows XP. Here is the modified code.
<StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
<CheckBox>
<Label Content="Username" Foreground="White"/>
</CheckBox>
<CheckBox>
<Label Content="Password" Foreground="White"/>
</CheckBox>
</StackPanel>
I have also seen this issue with radiobuttons. Use the same workaround for that and you should be good to go.
I hope this helps. If it does, feel free to leave a comment. Thanks!
I was asked to write some code to send an email through the default email client and I was pleasantly surprised as to how easy it was to do. I had never done this before, so it was a learning experience for me, so I thought I’d share it with all of you.
string toEmail = "from@email.com";
string subject = "Test Subject";
string body = "test email message text";
string message =
string.Format("mailto:{0}?subject={1}&body={2}",toEmail, subject, body);
Process.Start(message);
So that should do it. It’s pretty simple. When you run this code, you should see the default email client launch with the appropriate fields filled in.
Cheers!
Hey everyone. I decided to try some Windows Phone 7 development to see how easy or hard it is. So far, I have found it to be pretty easy since I’m a WPF and Silverlight developer. If you are a .Net developer and are interested in mobile development, I would highly encourage you to give WP7 development a try.
Here is a very simple application I wrote just to get my feet wet with WP7 development. It’s available as a free download in the marketplace, so if you have a Windows Phone 7 device, give it a shot and let me know what you think. Again, it is an extremely simple application, but if you are a baseball fan, it should be useful.
Let me know what you think.
Thanks!