|
I want the foreground color to be a bright color (the background color is black) and when the menu item is selected, a bright color gets washed out by the selection highlight. I don't see a property anywhere for changing the selection background color.
|
|
|
|
|
I have the same proplem, and can't find the solution.
Please send it for me, if you find it out!!
Thanks!
|
|
|
|
|
How setting menu selected Backcolor and menu selcted forecolor incode c#
|
|
|
|
|
What have you tried ? What does MSDN say ?
If you give your menu or menu item an x:Name, then you can access it's properties in the code behind.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I have a situation where when focused on a tab in a tabcontrol I may want to navigate the visual tree for the content in another tab however I am unable to do this since it has been unloaded (due to it's tab not being focused). Is there anyway I can force the visual tree to load?
|
|
|
|
|
You can do better than that. Have a look at this[^] post from Eric Burke.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
|
Hi,
I am working on a silverlight application. In this I have to change the background color of canvas dynamically. For this I used this
Canvas1.Background=new SolidColorBrush(Colors.Gray);
But I want to assign some custome color like #A1A1A1
For this I tried
Canvas1.Background = new SolidColorBrush(Color.FromArgb(........
But I am not get the actual color
If anyone have any idea to do this please reply me.
Thanks in Advance
|
|
|
|
|
#A1A1A1 is not an ARGB colour - it's an RGB colour. The A refers to the opacity of the color (it means Alpha), and this needs to be appended to the front, so a solid color would be #FFA1A1A1.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Is this message board a correct place to ask remoting and webservices related doubts?
|
|
|
|
|
No,but kudos for taking the time to find out. If you wanted to ask about how WCF worked, this would be the place. Depending on what you want to know, you should look at the C# (or VB.NET) forum, the .NET forum or the ASP.NET forum for pure web service help.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hi,
I am working on silverlight project. In this I designed Page.xaml and called it in a aspx page. But now when I run the application for small size monitors it is displaying a part of the page and cannot view remaining page. Aslo I am not even getting scroll bar for the page to view the whole content of the page. For large size monitors it is displaying all the content in the page.
Please reply me how can I change sttings to display scroll bars to view all the content.
Thanks in advance.
|
|
|
|
|
You could wrap your root element in a ScrollViewer element.
MArk
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Question was: how do I convert a hex string to a Media.Color, with the hope that .Net 3.5 was mature enough to provide a method.
I found the solution and wanted to delete the thread...
1) add a reference to System.Drawing
2) System.Drawing contains overloaded fromArgb() so that I don't have to bit-shuffle
EDIT: but this approach didn't work...
modified on Wednesday, September 16, 2009 8:43 PM
|
|
|
|
|
abiemann wrote: I don't want to split up the hex value into single bytes. I feel that I shouldn't have to.
Sometimes, a programmer has to actually program. Sometimes, they have to do some basic things like conversion of numbers. Sometimes, they have to look up stuff like the Colors enum. Your two colors here are Color.Black and Color.Transparent ( as it's ARGB ).
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
"Value of type 'System.Drawing.Brush' cannot be converted to 'System.Windows.Media.Brush'"
BAH!!
|
|
|
|
|
Well, you need to explicitly scope it. I think if you want to use the build in ones, it's Brushes, not Brush, too. My bad.
I would agree that MS having objects of the same name in different namespaces is a PITA.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
I think I saw people doing this back in the VB6 days, here is the VB.Net version
Private Function ConvertHexToColor(ByVal strInput As String) As Color<br />
<br />
strInput = strInput.Replace("#", "")<br />
<br />
Dim alph As Integer = 0<br />
Dim red As Integer = 0<br />
Dim green As Integer = 0<br />
Dim blue As Integer = 0<br />
Dim colToReturn As Color = Color.FromRgb(red, green, blue) 'default if input is invalid<br />
<br />
If (strInput.Length = 6) Then<br />
'RRGGBB<br />
red = Convert.ToInt32(strInput.Substring(0, 2), 16)<br />
green = Convert.ToInt32(strInput.Substring(2, 2), 16)<br />
blue = Convert.ToInt32(strInput.Substring(4, 2), 16)<br />
colToReturn = Color.FromRgb(red, green, blue)<br />
ElseIf (strInput.Length = 8) Then<br />
'AARRGGBB<br />
alph = Convert.ToInt32(strInput.Substring(0, 2), 16)<br />
red = Convert.ToInt32(strInput.Substring(2, 2), 16)<br />
green = Convert.ToInt32(strInput.Substring(4, 2), 16)<br />
blue = Convert.ToInt32(strInput.Substring(6, 2), 16)<br />
colToReturn = Color.FromArgb(alph, red, green, blue)<br />
End If<br />
<br />
Return colToReturn<br />
<br />
End Function
to use:
<br />
Public MainMenu_Background As Brush<br />
MainMenu_Background = New SolidColorBrush(ConvertHexToColor("#FF000000")) 'Black<br />
myControl.Background = MainMenu_Background<br />
hopefully .Net 4.0 will see an improvement like this
|
|
|
|
|
There is ColorConverter, which is the TypeConverter WPF uses.
this.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#00FF00"));
|
|
|
|
|
Hi,
I have 3 check boxes.. 1.select all 2. team1, 3. team2.
If i check Select all , then all the 3 check boxes should be checked.
If I unselect team1 or team2 after i have checked selectall, then selectall should be unchecked and team1 and team2 still be checked.
--> on select all, all 3 should be checked..
--> on unchecking either team1 or team2 after checking select all, then select all shuld be unchecked.
--> individual checking is allowed.
I am able to do for the select all but not successful in the second half.
Please help me.
Thanks
Ramm
|
|
|
|
|
Hi,
Is there any way in which I can change this property without overwriting the entire control template. I've seen this done in some examples but I can't set the template for the DatagridColumnHeadersPresenter in my xaml file. I can access the headers and style them. I'm a bit new to control templates in wpf. Any help would be appreciated.
|
|
|
|
|
Hi,
I am working on WPF 3.5 SP1 using Visual Studio 2008. My developed applications are not running on various machines which also has .Net 3.5 SP1. In some machines they are working fine & in others they failed to load.
I checked everything including code, but didn't find anything to resolve. Can anyone please help me asap to resolve the same issue? Your kind help is highly appreciated.
Regards,
- Kunal
|
|
|
|
|
Try 2 log exception details or just check vats the exception.Otherwise how can u fix that?
|
|
|
|
|
Not sure what specific help you expect here, except to point out the obvious - check the specs of the machines in question, check their video card drivers, tell us what error you get when they fail to load, etc.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Hi Chris,
After doing a deep debug, I came to know that, it is throwing "FileFormatException" for image: "The image format is unrecognized".
I am using gif/jpg/png formats. I also tried replacing the gif image with a new png image. In that case also, it is throwing the same exception & refuses to run. The image source is specified in the XAML in the following syntax: "images\myLogo.png"
FYI, it is working fine in my development PC & other PCs having Windows 7, but, it is refusing to run on Windows XP & Vista machines.
What could be the reason? Any idea???? Please HELP...
Regards,
- Kunal
|
|
|
|