|
One possibility could be to create the treeview as an adorner, which sits in the adorner layer.
|
|
|
|
|
I have a group of 3 radio button. I would like to databind a integer value variable to control them. For example, if variable is 2, then radio button 2 is check while the rest is not.
Any suggestion to the implementation?
|
|
|
|
|
I would do something along these lines, maybe somebody else has a better idea!
List<bool?> vals = new List<bool?>
vals.Add(false)
vals.Add(true)
vals.Add(true)
void SetVal(int index)
{
foreach(bool? b in vals)
b=false;
vals[index] = true;
}
XAML
<RadioButton x:name="rb1" IsChecked="{Binding Path=vals[0]}"/>
<RadioButton x:name="rb1" IsChecked="{Binding Path=vals[1]}"/>
<RadioButton x:name="rb1" IsChecked="{Binding Path=vals[2]}"/>
|
|
|
|
|
You are looking for an effect similar to a RadioButtonList.
The bad news: WPF doesn't ship with one of these by default.
The good news: They are fairly easy to put together, and there are numerous samples. Here's[^] a good one from Matthew Macdonald. If you haven't bought the Pro WPF book (there are C# and VB.NET editions), you owe it to yourself to buy this book now - it's a fantastic resource.
|
|
|
|
|
Hi ,
i Need to create a WPF applciation using WPF. i have so seen so many sidebar gadgets creation for sidebar in vista , but i want to create my own sidebar usingW WPF.
any help?
Thanks in advance.
|
|
|
|
|
|
garima_sri_08 wrote: create a WPF applciation using WPF
What else would you create a WPF application other than WPF
A Gadget is simply html, using Silverlight would be more appropriate.
only two letters away from being an asset
|
|
|
|
|
Hey guys i would like to get the selected item inside the listboxitem
and change his look , here is the code of my listbox...
i would like to change "FutureExtension" Background or something...
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
<StackPanel Orientation="Horizontal" >
<my2:FutureExtension x:Name="T2" Loaded="T2_Loaded" Grid.Row="3" Margin="1,1,10,10"></my2:FutureExtension>
<my2:FutureExtension x:Name="T3" Loaded="T3_Loaded" Grid.Row="3" Margin="1,1,10,10"></my2:FutureExtension>
<my2:FutureExtension x:Name="T4" Loaded="T4_Loaded" Grid.Row="3" Margin="1,1,10,10"></my2:FutureExtension>
</StackPanel>
<!--<Border Height="20" Background="Black" BorderBrush="Orange" BorderThickness="3">
</Border>-->
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
|
|
|
|
|
The wonderful Bea Costa provides a fantastic sample that you can use as the basis of this. Find out about it here[^].
|
|
|
|
|
Hi,
I am finding for WPF control/code which gives me combination of both treeview and listview.
In which i can add combobox, datetime picker control, checkbox etc.
Thanks
hiren shah
|
|
|
|
|
Hiren,
Can you rephrase your question. Its not clear what you need help with.
FYI: In WPF you can add almost any control to ItemsControl.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Hi Karl,
I am newbie in WPF. I don't know much about item Control.
I want to use TreeListView in my project. something like
http://www.codeproject.com/KB/list/treelistview.aspx
but above one is in win form i want to use in WPF window.
TreeView with checkbox as well as expander button(+,-) like in win explorer.
And ListView containing ComboBox, DateTimeControl and textbox.
Also tell me from where do i start learning WPF.
Triggers, XAML, items control, data binding etc.
Thanks
hiren shah
|
|
|
|
|
Hiren,
There are tutorials here on Code Project.
Both Josh Smith and Sacha Barber has writen great tutorials.
You can also use the Internet to research any topic in WPF.
You can also purchase a book from Amazon.com.
I like Matthew McDonald's book on WPF. He has one for C# and VB.NET.
You can use the WPF TreeView control to do what you want.
Suggest doing an Internet search on "wpf treeview" and you'll get plenty of examples.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
You mean like this[^] article.
|
|
|
|
|
Hey friends.
What are the differences between Triggers and events in WPF ?
Thank you
|
|
|
|
|
Have you read the MSDN documentation or did a Google search on Triggers and Events?
There are also many WPF tutorials here on Code Project written by Josh Smith and Sacha Barber.
modified 27-Feb-21 21:01pm.
|
|
|
|
|
Greetings all and happy new year!
My WPF application, in the menu and other areas, for some reason is not displaying my "Arial" font properly. I don't understand what's going on. All my menu (and other items) have Arial font. Albeit some have a different size or thickness (e.g. bold or normal). However, it's all Arial. In addition, it shows up normal in the preview window. However, when I run it, it displays words using different sizes and weights for the letters in a given word.
Any ideas about what I can do?
Thanks in advance.
Blitz
|
|
|
|
|
Could you post the snippet code of your XAML code ?
|
|
|
|
|
Thanks for replying. Below is a code snippet from the menu.
<Menu Margin="0,0,0,0" Grid.ColumnSpan="3" Grid.Row="1" x:Name="MenuMain" Background="{DynamicResource BrushLinearGradientGray}">
<MenuItem FontFamily="./Fonts\#Arial" FontSize="14" FontWeight="Normal" Foreground="{DynamicResource SecondaryGradient}" HorizontalContentAlignment="Center" Padding="2,6,0,0" VerticalContentAlignment="Center" Margin="0,0,0,0" x:Name="MenuItemPersonalize" Width="94.516" Height="30.883" d:IsStaticText="True" Header="Personalize">
<MenuItem Header="Mode" x:Name="MenuItemMode" Foreground="#FF000000" Background="{DynamicResource SecondaryGradient}"/>
<MenuItem Header="Settings" x:Name="MenuItemSettings" Background="{DynamicResource SecondaryGradient}" Foreground="#FF000000"/>
</MenuItem>
</Menu>
Sorry if it looks jumbled, I don't know yet how to post code in these forums. Any help or direction would be greatly appreciated.
<div class="ForumMod">modified on Monday, January 19, 2009 11:22 PM</div>
|
|
|
|
|
BlitzPackage wrote: Sorry if it looks jumbled, I don't know yet how to post code in these forums. Any help or direction would be greatly appreciated.
You must use > instead of >
and < instead of <
and &quot; instead of "
and & instead of &
If you have a HTML Editor , please firs write your text there and then cheque it and the post it here.
|
|
|
|
|
Ok, check it now; I was able to finally post it.
|
|
|
|
|
Have you ever tried FontFamily="Arial" instead of the yours
|
|
|
|
|
Thanks so much! That fixed it.
See, Expression Blend generated: "#Arial". Once I wrote "Arial", like you suggested, it worked.
Thanks again.
|
|
|
|
|
You're welcome
|
|
|
|
|
Hey experts .
I've created several Grid in my App.
<Grid x:Name="GridShanbe0">
.
.
.
</Grid>
Then I've created a style in App.xaml file for all of them :
<Style TargetType="{x:Type Grid}">
<EventSetter Event="UIElement.MouseLeftButtonDown" Handler="Grid_MouseLeftButtonDown" />
</Style>
But whenever I'm gonna compile the App, this error has occurred
'WPF.App' does not contain a definition for 'Grid_MouseLeftButtonDown' and no
extension method 'Grid_MouseLeftButtonDown' accepting a first argument of type
'WPF.App' could be found (are you missing a using directive or an assembly reference?)
I'm sure I've created Grid_MouseLeftButtonDown method.
What's wrong ?
Thank you
|
|
|
|