Apply xaml style for FolderBrowserDialog in WPF - c#

I have a style Xaml which I use for styling my WPF windows. But the same style won't get applied for the FolderBrowseDialog which I use in my windows. This gives a weird UI difference between the actual windows and the dialog pop-ups. How to get this corrected?

As far as I know unfortunately you cannot. Either you have to create your own user control or use some of the already defined in the internet.
One cool with a lot of other fancy controls is in Kevin Moore's Bag-o-Tricks.

Related

My WPF DataGrid is being styled but I don't know where it is doing that

We have a WPF application with multiple teams sharing assemblies to develop an integrated application. Some windows in our application are WPF and XAML.
Today I integrated some DLLs into our application from another team and suddenly, my DataGrid is being styled differently. It is also giving me runtime errors where the DataGrid is showing zero columns, when I know very well that I add columns dynamically in my code during runtime.
What could be causing this?
Is it possible that someone in our team is creating a global style for all DataGrids? Now my DataGrids are being affected?
I am not an expert in WPF but that is my guess. Can this be possible?
Thanks
Yes it is possible, check the other teams for generic styles being put into app.xaml as that seems pretty common, otherwise make sure they know to only style for specific groups (ie a datagrid on a page referencing a particular style for a page/window)
With no more info I cannot help you any further other than to remove the dlls and show it works, then add them and show it doesn't. Make sure your own styles are not enforcing anything onto all datagrids (as that could give you an error if it applies it to any in the DLLs).

C# Winform: Remove the border from a standard button?

Is it possible to remove the border of a standard C# Button ? I know that I could set the FlatStyle property to Flat and customize the FlatAppearance property to hide the border but I would prefer to use the Standard property to ensure that the control appears under all operating systems like a default Button. Did you have any suggestions how I can solve this issue? I am working with a Windows Forms Application.
You could use an image and make it clickable, that is one way to avoid the borders, but there are several options. Good luck!
If you are using windows forms and trying to implement Flat UI, Material UI, Metro-Looking controls, you're in hell. It is has limited properties for customizations unless you know how to work with Graphics and Animation. You'll have to use imagebox or picture box and dynamically change its image on different events.
I'll suggest WPF or Windows Presentation Foundation for a more customizable User Interface.

Own controls similar to TextBox in C# Windows application

Create own TextBox, Button etc control as own control using User control in C# Windows application, is this good idea?
I wanted make consistency for through out the application. Suppose if I want to change the Textbox border color then all forms textbox updated with this changes. It's just an example.
Please suggest me.
I don't recommend using UserControl just for consistency. If application skinning is what you are after, look into WPF. It makes it relatively simple to skin an application (or even a window, or smaller groups)
Here is an article on skinning with WPF: http://www.codeproject.com/Articles/19782/Creating-a-Skinned-User-Interface-in-WPF
Another alternative, staying within Windows Forms, is creating a class that inherits from TextBox, and using that class throughout the application. The Factory pattern would work well here. You could even adapt it to multiple skins.
It's not a bad idea to provide custom controls that match your "User Experience" (UX). It really just depends on what you are trying to accomplish with your program.

Styling Silverlight Telerik AppointmentDialogWindow

So I am using Silverlight telerik RadScheduler. When creating an appointment using this control an AppointmentDialogWindow pops up. Now, I want to change the look of the window (i.e. its borders, frame etc.)
I am pretty good with Blend but I guess some code - behind will be necessary to set the window style for this Dialog Window.
Any Suggestions?
If you have the full source, go the the specific Theme folder you are looking to implement and grab the SchedulerView.xaml file from there. This is the style file for that specific control.
Reference this resource as a ResourceDictionary in App.xaml or the respective page you will implement the control.
Now when you edit this style sheet it will directly affect how the SchedulerView control operates, including it's child windows.
Warning: this is a cumbersome pain in the neck. Telerik doesn't really like people messing with their styles, and they have acknowledged that they do no typically make it easy for their existing styles to be modified.
Here is how to implement a custom theme:
http://www.telerik.com/help/silverlight/common-styling-apperance-themes-custom-theme-project-telerik-approach.html

How to choose between different styles in WPF XAML

I am creating a popup dialog using microsoft's WPF.
The thing is that this popup must support two or more different styles, for instance, depending on how it is called the popup must have a red background and white text in the foreground, or it must have a white background and gray text in the foreground.
What I would like to do is create as many styles as necessary in my xaml file and just choose each of them depending on how the popup was created, therefore I would like to know if it is possible to create something like this (kind of a dynamically applied style) inside the .xaml file, or if it is better to just do this programatically in the code behind.
Also please note that I am using the Visual Studio 2010 with the .NET Framework 4.0.
Thanks,
Felipe
I would define an enumeration that names the styles, then either use DataTriggers to set the style on the control from a wrapping border.

Categories