本文整理汇总了C#中System.Windows.Controls.DockPanel类的典型用法代码示例。如果您正苦于以下问题:C# DockPanel类的具体用法?C# DockPanel怎么用?C# DockPanel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DockPanel类属于System.Windows.Controls命名空间,在下文中一共展示了DockPanel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: PageHeader
public PageHeader()
{
Brush brush = new SolidColorBrush(Colors.DarkGray);
brush.Opacity = 0.60;
this.Background = brush;
Border frameBorder = new Border();
frameBorder.BorderBrush = Brushes.Gray;
frameBorder.BorderThickness = new Thickness(2);
DockPanel panelMain = new DockPanel();
panelMain.Margin = new Thickness(5, 5, 5, 5);
panelMain.VerticalAlignment = System.Windows.VerticalAlignment.Bottom;
txtText = new TextBlock();
txtText.FontSize = 32;
txtText.Margin = new Thickness(5, 0, 0, 0);
txtText.SetResourceReference(TextBlock.ForegroundProperty, "HeaderTextColor");
txtText.VerticalAlignment = System.Windows.VerticalAlignment.Bottom;
panelMain.Children.Add(txtText);
frameBorder.Child = panelMain;
this.Content = frameBorder;
}
开发者ID:rhgtvcx,项目名称:tap-desktop,代码行数:27,代码来源:PageHeader.cs
示例2: WindowControl
// Vehicles Dock Panel
public WindowControl(Window MainWindow,
List<BitmapImage> Images, Image IViewer, // Image viewer
DockPanel DockPanelStates, // States Dock Panel
DockPanel DockPanelVehicles)
{
InitializeComponent();
// Initialize
this.mainWindow = MainWindow;
this.images = Images;
this.iViewer = IViewer;
this.dockPanelStates = DockPanelStates;
this.dockPanelVehicles = DockPanelVehicles;
this.slide = 0;
this.image = 0;
// Set up the intial image viewer
this.iViewer.Source = this.images[this.image]; // 0.jpg
this.iViewer.Stretch = Stretch.Fill;
// Configure the initial main window content
this.mainWindow.Content = this.iViewer;
// Update info
this.LabelInfo.Content = "Viewing slide: " + this.slide.ToString();
this.LabelNext.Content = "Next slide: " + (this.slide + 1).ToString();
}
开发者ID:Tribeman,项目名称:CS422,代码行数:28,代码来源:WindowControl.xaml.cs
示例3: CreateColourPickerDockPanel
private DockPanel CreateColourPickerDockPanel()
{
DockPanel dockPanel = new DockPanel()
{
HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Top,
Margin = new Thickness(4),
};
dockPanel.Children.Add(new ColorCanvas() { SelectedColor = SelectedColour, Margin = new Thickness(4) });
dockPanel.Children.Add(new Button()
{
IsDefault = true,
Padding = new Thickness(16, 4, 16, 4),
Margin = new Thickness(4),
Content = "Select Color",
HorizontalAlignment = HorizontalAlignment.Center
});
dockPanel.Children.OfType<ColorCanvas>().First().SetValue(DockPanel.DockProperty, Dock.Top);
dockPanel.Children.OfType<Button>().First().Click += new RoutedEventHandler(ColourPickerDialogOkay_Click);
return dockPanel;
}
开发者ID:pankajbhandari08,项目名称:windows-tweaker,代码行数:25,代码来源:ColorPickerDialog.cs
示例4: FormatRichText
public FormatRichText()
{
Title = "Format Rich Text";
// Create DockPanel as content of window.
DockPanel dock = new DockPanel();
Content = dock;
// Create ToolBarTray docked at top of client area.
ToolBarTray tray = new ToolBarTray();
dock.Children.Add(tray);
DockPanel.SetDock(tray, Dock.Top);
// Create RichTextBox.
txtbox = new RichTextBox();
txtbox.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
// Call methods in other files.
AddFileToolBar(tray, 0, 0);
AddEditToolBar(tray, 1, 0);
AddCharToolBar(tray, 2, 0);
AddParaToolBar(tray, 2, 1);
AddStatusBar(dock);
// Fill rest of client area with RichTextBox and give it focus.
dock.Children.Add(txtbox);
txtbox.Focus();
}
开发者ID:gawallsibya,项目名称:BIT_MFC-CShap-DotNet,代码行数:28,代码来源:FormatRichText.cs
示例5: CreatePanels
void CreatePanels()
{
int nbPanels = _panel.MaxColumnByRowProperty * _panel.MaxRowProperty;
int column = 0;
int row = 0;
bool rightDirection = true;
for( int i = 0; i < nbPanels; i++ )
{
DockPanel dp = new DockPanel();
dp.DataContext = _panel.Panels[i];
dp.SetBinding( DockPanel.BackgroundProperty, new Binding( "IsActive" ) { Converter = new BooleanToColor() } );
Grid.SetColumn( dp, column );
Grid.SetRow( dp, row );
SplitGrid.Children.Add( dp );
if( rightDirection ) column++;
else column--;
if( column >= _panel.MaxColumnByRowProperty && rightDirection )
{
row++;
column--;
rightDirection = false;
}
else if( column == -1 && !rightDirection )
{
row++;
rightDirection = true;
column++;
}
_dockPanels.Add( dp );
}
}
开发者ID:jmathon,项目名称:WPF-Split-Screen,代码行数:35,代码来源:GridZone.xaml.cs
示例6: SelectFolderPopupCenter
public SelectFolderPopupCenter()
{
sf.FolderChanged += sf_FolderChanged;
StackPanel spWrapper = new StackPanel();
spWrapper.Orientation = Orientation.Vertical;
spWrapper.Children.Add(sf);
DockPanel dp = new DockPanel();
dp.LastChildFill = false;
Button btnCancel = new Button();
btnCancel.Content = "Cancel";
btnCancel.Click += btnCancel_Click;
btnCancel.Margin = new Thickness(5);
DockPanel.SetDock(btnCancel, Dock.Right);
btnOk = new Button();
btnOk.IsEnabled = false;
btnOk.Content = "OK";
btnOk.Click += btnOk_Click;
btnOk.Margin = new Thickness(5);
DockPanel.SetDock(btnOk, Dock.Right);
dp.Children.Add(btnCancel);
dp.Children.Add(btnOk);
spWrapper.Children.Add(dp);
this.Content = spWrapper;
}
开发者ID:sunamo,项目名称:AllProjectsSearch,代码行数:29,代码来源:SelectFolderPopupCenter.cs
示例7: GetProperyField
public override FrameworkElement GetProperyField()
{
var pan = new DockPanel();
t = (new TextBox());
try
{
t.Text = GetVaueAsType<ImageSource>().ToString();
}
catch { }//Null value
t.TextChanged += delegate(object sender, TextChangedEventArgs e) { SetString(t.Text); };
var btn = new Button();
btn.Content = "...";
btn.Click += delegate
{
var fpd = new System.Windows.Forms.OpenFileDialog();
fpd.Filter = "Images|*.jpg;*.jpeg;*.png;*.gif;*.tif;*.bmp";
if (fpd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
t.Text = fpd.FileName;
}
};
DockPanel.SetDock(btn, Dock.Right);
pan.Children.Add(btn);
pan.Children.Add(t);
return pan;
}
开发者ID:byteit101,项目名称:ZomB-Dashboard-System,代码行数:26,代码来源:ImageSourceDesigner.cs
示例8: BuildPropertyGrid
void BuildPropertyGrid()
{
dockPanel = new DockPanel {LastChildFill = true, Width = 200, Height = 400,};
wpfPropertyGrid = new WpfPropertyGrid{SelectedObject = AdornedElement, HelpVisible = true};
dockPanel.Children.Add(wpfPropertyGrid);
visualChildren.Add(dockPanel);
}
开发者ID:lokswin,项目名称:ivu-cher,代码行数:7,代码来源:PropertyGridAdorner.cs
示例9: KoncowyTest
public KoncowyTest(List<string[]> slowa)
{
InitializeComponent();
labels = new Label[15];
textboxes = new TextBox[15];
this.slowa = slowa;
for (int i = 0; i < 15; i++)
{
labels[i] = new Label();
textboxes[i] = new TextBox();
labels[i].Content = slowa[i][0];
labels[i].Margin = new Thickness(0,5,0,5);
textboxes[i].Margin = new Thickness(0, 5, 0, 5);
textboxes[i].MinWidth = 50;
DockPanel dock = new DockPanel();
dock.MinWidth = 200;
var sep = new Separator();
sep.MinWidth = 50;
sep.Visibility = Visibility.Hidden;
;
dock.Children.Add(labels[i]);
dock.Children.Add(sep);
dock.Children.Add(textboxes[i]);
StackPanel.Children.Add(dock);
}
}
开发者ID:kypp,项目名称:word-recall-test,代码行数:27,代码来源:KoncowyTest.xaml.cs
示例10: DockAroundTheBlock
public DockAroundTheBlock()
{
Title = "Dock Around the Block";
// 1. �г� ���� �� �ʱ�ȭ
DockPanel dock = new DockPanel();
Content = dock;
// 2. ���ϴ� �ڽ� ��ü(�̹���, ��Ʈ��, �г�..)
for (int i = 0; i < 17; i++)
{
Button btn = new Button();
btn.Content = "Button No. " + (i + 1);
//-------------------------------------------------
dock.Children.Add(btn);
btn.SetValue(DockPanel.DockProperty, (Dock)(i % 4));
DockPanel.SetDock(btn, (Dock)(i % 4));
//-------------------------------------------------
}
// dock.LastChildFill = true;
dock.LastChildFill = false;
}
开发者ID:gawallsibya,项目名称:BIT_MFC-CShap-DotNet,代码行数:26,代码来源:DockAroundTheBlock.cs
示例11: OnApplyTemplate
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
_ui_txtTitle = (TextBlock)GetTemplateChild("_ui_txtTitle");
if (null != (_ui_btnOpenClose = (Button)GetTemplateChild("_ui_btnOpenClose")))
_ui_btnOpenClose.Click += new RoutedEventHandler(_ui_btnOpenClose_Click);
_ui_rectOpenClose = (Rectangle)GetTemplateChild("_ui_rectOpenClose");
_ui_brdContent = (Border)GetTemplateChild("_ui_brdContent");
_ui_cntContent = (ContentControl)GetTemplateChild("_ui_cntContent");
if (null != (_ui_dpHeader = (DockPanel)GetTemplateChild("_ui_dpHeader")))
_ui_dpHeader.MouseLeftButtonDown += new MouseButtonEventHandler(_ui_dpHeader_MouseLeftButtonDown);
// Image cImg = new Image();
ImageBrush cIB = new ImageBrush();
cIB.ImageSource = new System.Windows.Media.Imaging.BitmapImage(new Uri("/controls.sl;component/Images/rp_open.png", UriKind.Relative));
cIB.Stretch = Stretch.None;
_cOpenSymbol = cIB; // = cImg;
cIB = new ImageBrush();
cIB.ImageSource = new System.Windows.Media.Imaging.BitmapImage(new Uri("/controls.sl;component/Images/rp_close.png", UriKind.Relative));
cIB.Stretch = Stretch.None;
_cCloseSymbol = cIB; //= cImg;
if(Title.IsNullOrEmpty())
Title = g.Common.sName;
ProcessTitle();
ProcessIsOpen();
}
开发者ID:ratsil,项目名称:bethe.helpers,代码行数:29,代码来源:ReducePanel.xaml.cs
示例12: MainWindow
public MainWindow ()
{
Title = "Mono Windows Presentation Foundation utility";
MenuItem color_finder_menu = new MenuItem ();
color_finder_menu.Header = "_Color finder";
color_finder_menu.Click += delegate (object sender, RoutedEventArgs e)
{
new ColorFinder.ColorFinderWindow ().Show ();
};
MenuItem visual_structure_viewer_menu = new MenuItem ();
visual_structure_viewer_menu.Header = "_Visual structure viewer";
visual_structure_viewer_menu.Click += delegate (object sender, RoutedEventArgs e)
{
new VisualStructureViewer.VisualStructureViewerWindow ().Show ();
};
MenuItem utilities_menu = new MenuItem ();
utilities_menu.Header = "_Utilities";
utilities_menu.Items.Add (color_finder_menu);
utilities_menu.Items.Add (visual_structure_viewer_menu);
Menu menu = new Menu ();
menu.Items.Add (utilities_menu);
DockPanel contents = new DockPanel ();
contents.LastChildFill = false;
DockPanel.SetDock (menu, Dock.Top);
contents.Children.Add (menu);
Content = contents;
}
开发者ID:JianwenSun,项目名称:mono-soc-2007,代码行数:33,代码来源:MainWindow.cs
示例13: HideAllPanelsExceptOf
private void HideAllPanelsExceptOf(DockPanel dockPanel)
{
UIElementCollection children = ControlPanel.Children;
int index = children.IndexOf(dockPanel);
for (int i = 0; i < children.Count; ++i)
if (i != index) children[i].Visibility = Visibility.Collapsed;
}
开发者ID:kverhun,项目名称:SignalProcessor,代码行数:7,代码来源:MenuHandlers.cs
示例14: Add_Click
private void Add_Click(object sender, RoutedEventArgs e)
{
DockPanel dp = new DockPanel();
dp.Width = 200;
dp.Height = 23;
dp.HorizontalAlignment = HorizontalAlignment.Left;
dp.VerticalAlignment = VerticalAlignment.Top;
Button X = new Button();
X.Height = 23;
X.Width = 30;
X.Content = "X";
X.VerticalAlignment = VerticalAlignment.Top;
X.HorizontalAlignment = HorizontalAlignment.Left;
X.Click += X_Click;
TextBox tb = new TextBox();
tb.Height = 23;
tb.Width = 170;
tb.HorizontalAlignment = HorizontalAlignment.Left;
tb.VerticalAlignment = VerticalAlignment.Top;
tb.FontFamily = new FontFamily("Times New Roman");
tb.BorderBrush = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#FF707070"));
dp.Children.Add(tb);
dp.Children.Add(X);
SearchGrid.Children.Add(dp);
}
开发者ID:DmytriyShtepa,项目名称:TextFinder,代码行数:29,代码来源:MainWindow.xaml.cs
示例15: When_adding_a_view_to_the_layout_should_add_view_to_panel_children_collection
public void When_adding_a_view_to_the_layout_should_add_view_to_panel_children_collection()
{
Panel element = new DockPanel();
PanelDecoratingLayout layout = new PanelDecoratingLayout(element);
layout.AddView(new DemoView());
Assert.AreEqual(1, element.Children.Count);
}
开发者ID:JackWangCUMT,项目名称:rhino-tools,代码行数:7,代码来源:PanelDecoratingLayoutFixture.cs
示例16: WindowBackend
public WindowBackend()
{
Window = new System.Windows.Window ();
rootPanel = new DockPanel ();
Window.Content = rootPanel;
}
开发者ID:carlosalberto,项目名称:xwt,代码行数:7,代码来源:WindowBackend.cs
示例17: CheckTheWindowStyle
public CheckTheWindowStyle()
{
Title = "Check the Window Style";
DockPanel dock = new DockPanel();
Content = dock;
Menu menu = new Menu();
dock.Children.Add(menu);
DockPanel.SetDock(menu, Dock.Top);
TextBlock text = new TextBlock();
text.Text = Title;
text.FontSize = 32;
text.TextAlignment = TextAlignment.Center;
dock.Children.Add(text);
MenuItem itemStyle = new MenuItem();
itemStyle.Header = "_Style";
menu.Items.Add(itemStyle);
itemStyle.Items.Add(CreateMenuItem("_No border or caption", WindowStyle.None));
itemStyle.Items.Add(CreateMenuItem("_Single-border window", WindowStyle.SingleBorderWindow));
itemStyle.Items.Add(CreateMenuItem("3_D-border window", WindowStyle.ThreeDBorderWindow));
itemStyle.Items.Add(CreateMenuItem("_Tool window", WindowStyle.ToolWindow));
}
开发者ID:JianchengZh,项目名称:kasicass,代码行数:26,代码来源:CheckTheWindowStyle.cs
示例18: MultiColumnTreeViewItem
internal MultiColumnTreeViewItem (TreeViewBackend treeView, TreeNode node)
{
Node = node;
TreeView = treeView;
(Node as TreeNode).TreeViewData.Add (Tuple.Create<TreeViewBackend, SWC.ItemsControl>(TreeView, this));
Header = DockPanel = new SWC.DockPanel ();
}
开发者ID:m13253,项目名称:xwt,代码行数:7,代码来源:MultiColumnTreeViewItem.cs
示例19: CutCopyPaste
//[STAThread]
//public static void Main()
//{
// Application app = new Application();
// app.Run(new CutCopyPaste());
//}
public CutCopyPaste()
{
Title = "Cut ,Copy,and Paste";
//DockPanel 생성
DockPanel dock = new DockPanel();
Content = dock;
//탑 메뉴가 될 Menu 생성
Menu menu = new Menu();
dock.Children.Add(menu);
DockPanel.SetDock(menu, Dock.Top);
//나머지 영역을 채울 TextBlock을 생성
text = new TextBlock();
text.Text = "Sample clipboard text";
text.FontSize = 32;
text.HorizontalAlignment = HorizontalAlignment.Center;
text.VerticalAlignment = VerticalAlignment.Center;
text.TextWrapping = TextWrapping.Wrap;
dock.Children.Add(text);
//Edit 메뉴 생성
MenuItem itemEdit = new MenuItem();
itemEdit.Header = "_Edit";
itemEdit.SubmenuOpened += EditOnOpened;
menu.Items.Add(itemEdit);
//Edit 메뉴 항목 생성
itemCut = new MenuItem();
itemCut.Header = "Cu_t";
itemCut.Click += CutOnClick;
Image img = new Image();
img.Source = new BitmapImage(new Uri("http://image-0.poco.cn/pic_center/img/099/0836c2fc677eb3400a0049b746a5b308_640.jpg"));
itemCut.Icon = img;
itemEdit.Items.Add(itemCut);
itemCopy = new MenuItem();
itemCopy.Header = "_Copy";
itemCopy.Click += CopyOnClick;
img = new Image();
img.Source = new BitmapImage(new Uri("http://www.onegreen.net/QQ/UploadFiles/200806/200861551027277.gif"));
itemCopy.Icon = img;
itemEdit.Items.Add(itemCopy);
itemPaste = new MenuItem();
itemPaste.Header = "_Paste";
itemPaste.Click += PasteOnClick;
img = new Image();
img.Source = new BitmapImage(new Uri("http://www.onegreen.net/QQ/UploadFiles/200806/200861551027422.gif"));
itemPaste.Icon = img;
itemEdit.Items.Add(itemPaste);
itemDelete = new MenuItem();
itemDelete.Header = "_Delete";
itemDelete.Click += DeleteOnClick;
img = new Image();
img.Source = new BitmapImage(new Uri("http://www.onegreen.net/QQ/UploadFiles/200806/200861551027518.jpg"));
itemDelete.Icon = img;
itemEdit.Items.Add(itemDelete);
}
开发者ID:gawallsibya,项目名称:BIT_MFC-CShap-DotNet,代码行数:66,代码来源:CutCopyPaste.cs
示例20: fillCompletedListBox
void fillCompletedListBox()
{
CompletedActivityList = dataHandler.ReadCompletedActivities();
completedActivitiesListBox.Items.Clear();
foreach (Activity activity in CompletedActivityList)
{
DockPanel dockpanel = new DockPanel();
TextBlock blockText = new TextBlock();
blockText.Text = activity.Name;
dockpanel.Children.Add(blockText);
Image img = new Image();
BitmapImage bi = new BitmapImage();
bi.BeginInit();
if (activity.MeasureMent.Result < activity.ExpectedResultMin || activity.MeasureMent.Result > activity.ExpectedResultMax)
{
bi.UriSource = new Uri("/GUI/QualityAssuranceGUI/Resources/fail_icon.png", UriKind.Relative);
}
else
{
bi.UriSource = new Uri("/GUI/QualityAssuranceGUI/Resources/pass_icon.png", UriKind.Relative);
}
bi.EndInit();
img.Source = bi;
dockpanel.Children.Add(img);
dockpanel.MouseDown += OnDockPanelMouseDown;
dockpanel.Tag = activity;
completedActivitiesListBox.Items.Add(dockpanel);
}
}
开发者ID:DMOe15a,项目名称:ProjectMarmelade,代码行数:29,代码来源:QualityAssuranceStatus.xaml.cs
注:本文中的System.Windows.Controls.DockPanel类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论