随笔分类 -  WPF

摘要:<TreeView> <TreeViewItem Header="Desktop"> <TreeViewItem Header="Computer"> </TreeViewItem> </TreeViewItem> <TreeViewItem Header="Recycle Bin"> </TreeViewItem> <TreeViewItem Header="Control Panel"> <TreeViewIt 阅读全文
posted @ 2011-11-26 17:07 quietwalk 阅读(378) 评论(0) 推荐(0)
摘要:横排 <Menu> <MenuItem Header="_File"> <MenuItem Header="_New。¡ê。¡ê。¡ê"></MenuItem> <MenuItem Header="_Open。¡ê。¡ê。¡ê"></MenuItem> <Separator /> <MenuItem Header="S 阅读全文
posted @ 2011-11-26 17:06 quietwalk 阅读(188) 评论(0) 推荐(0)
摘要:<ListBox Name="lsTest"> <ListBox.ItemsPanel> <ItemsPanelTemplate> <VirtualizingStackPanel Orientation="Horizontal" /> </ItemsPanelTemplate> </ListBox.ItemsPanel> <ListBox.ContextMenu> <ContextMenu> <MenuItem Header="_File&qu 阅读全文
posted @ 2011-11-26 17:06 quietwalk 阅读(216) 评论(0) 推荐(0)
摘要:<ListView> <ListView.View> <GridView> <GridViewColumn Header="Date" /> <GridViewColumn Header="Day of Week"DisplayMemberBinding="{Binding DayOfWeek}" /> <GridViewColumn Header="Year"DisplayMemberBinding="{Binding Year}&quo 阅读全文
posted @ 2011-11-26 17:05 quietwalk 阅读(276) 评论(0) 推荐(0)
摘要:<TabControl> <TextBlock>Content for Tab 1.</TextBlock> <TextBlock>Content for Tab 2.</TextBlock> <TextBlock>Content for Tab 3.</TextBlock> </TabControl> TabControl 隐式地用它的TabItem类型包装每一个项。由于没有一个显式的TabItem,就没有办法产生相应的标签。 <TabControl> <TabItem Head 阅读全文
posted @ 2011-11-26 17:05 quietwalk 阅读(246) 评论(0) 推荐(0)
摘要:IsEditable:把 ComboBox变成一个文本框; IsReadOnly:决定文本框是否可以编辑; 只有 IsEditable为 true 时,IsReadOnly 才起作用。 <ComboBox> <!--Item #1--> <StackPanel Orientation="Horizontal" Margin="5"> <Image Source="/Pictures/1.jpg"></Image> <StackPanel Width="200& 阅读全文
posted @ 2011-11-26 17:04 quietwalk 阅读(341) 评论(0) 推荐(0)
摘要:SelectionMode Single Mulle Extended <ListBox Name="lsTest"> <ListBox.ItemsPanel> <ItemsPanelTemplate> <VirtualizingStackPanel Orientation="Horizontal" /> </ItemsPanelTemplate> </ListBox.ItemsPanel> <ListBoxItem>Item1</ListBoxItem> & 阅读全文
posted @ 2011-11-26 17:04 quietwalk 阅读(207) 评论(0) 推荐(0)
摘要:<Expander Header="Grammar"> <StackPanel> <CheckBox>Check grammar as you type</CheckBox> <CheckBox>Hide grammatical errors in this document</CheckBox> <CheckBox>Check grammar with spellling</CheckBox> </StackPanel> </Expander> Expa 阅读全文
posted @ 2011-11-26 17:03 quietwalk 阅读(242) 评论(0) 推荐(0)
摘要:<GroupBox> <GroupBox.Header> <Button>Select All</Button> </GroupBox.Header> <StackPanel> <CheckBox>Check</CheckBox> <CheckBox>Hide</CheckBox> <CheckBox>Display</CheckBox> </StackPanel> </GroupBox> 阅读全文
posted @ 2011-11-26 17:02 quietwalk 阅读(196) 评论(0) 推荐(0)
摘要:ToolTip for Button <Button> OK <Button.ToolTip> Clicking this will submit your request. </Button.ToolTip> </Button> ToolTip for CheckBox <CheckBox> CheckBox <CheckBox.ToolTip> <StackPanel> <Label FontWeight="Bold" Background="Blue" For 阅读全文
posted @ 2011-11-26 17:01 quietwalk 阅读(269) 评论(0) 推荐(0)
摘要:private void PrintVisialTree(int depth, DependencyObject obj) { System.Diagnostics.Debug.WriteLine(new string(' ', depth) + obj); for (int i = 0; i < VisualTreeHelper.GetChildrenCount(obj); i++) { PrintVisialTree(depth + 1, VisualTreeHelper.GetChild(obj, i)); } } protected overr... 阅读全文
posted @ 2011-11-25 10:11 quietwalk 阅读(154) 评论(0) 推荐(0)
摘要:private void PrintLogicalTree(int depth, object obj) { System.Diagnostics.Debug.WriteLine(new string(' ', depth) + obj); if (!(obj is DependencyObject)) { return; } foreach (object child in LogicalTreeHelper.GetChildren(obj as DependencyObject)) { PrintLogicalTree(depth + 1, chil... 阅读全文
posted @ 2011-11-25 10:06 quietwalk 阅读(179) 评论(0) 推荐(0)
摘要:Window window = null; using (FileStream fs = new FileStream("MyWindow.xaml", FileMode.Open, FileAccess.Read)) { window = (Window)System.Windows.Markup.XamlReader.Load(fs); } System.Windows.Controls.Button btnOk = (System.Windows.Controls.Button)window.FindName("btnOk"); 阅读全文
posted @ 2011-11-25 09:08 quietwalk 阅读(317) 评论(0) 推荐(0)
摘要:<Button xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> <Button.Content> <Rectangle Height="40" Width="40" Fill="Black" /> </Button.Content> </Button> System.Windows.Controls.Button button = new System.Windows.C 阅读全文
posted @ 2011-11-24 20:02 quietwalk 阅读(267) 评论(0) 推荐(0)
摘要:<ListView Height="264" HorizontalAlignment="Left" Margin="28,84,0,0" Name="listView1" VerticalAlignment="Top" Width="526" > <ListView.View> <GridView x:Name="gridView1"> <GridViewColumn Header="UserId&quo 阅读全文
posted @ 2011-11-22 08:50 quietwalk 阅读(17106) 评论(0) 推荐(0)