本文整理汇总了C#中System.Windows.Controls.GroupBox类的典型用法代码示例。如果您正苦于以下问题:C# GroupBox类的具体用法?C# GroupBox怎么用?C# GroupBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GroupBox类属于System.Windows.Controls命名空间,在下文中一共展示了GroupBox类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: GetGUIElement
public override FrameworkElement GetGUIElement()
{
var group = new GroupBox();
group.Header = WpfName;
var stackPanel = new StackPanel { Orientation = Orientation.Horizontal };
for (var i = 0; i < options.Length; ++i)
{
var checkBox = new CheckBox
{
Content = options[i],
DataContext = i,
IsChecked = chosenOptions.Contains(i)
};
checkBox.Margin = new Thickness(4, 3, 4, 3);
checkBox.Checked += (sender, args) =>
{ chosenOptions.Add((int)(sender as CheckBox).DataContext); };
checkBox.Unchecked += (sender, args) =>
{ chosenOptions.Remove((int)(sender as CheckBox).DataContext); };
stackPanel.Children.Add(checkBox);
}
group.Content = stackPanel;
return group;
}
开发者ID:Art1stical,项目名称:AHRUnrealEngine,代码行数:29,代码来源:MultipleChoiceParam.cs
示例2: Init
private void Init()
{
config = new SyntaxTreeConfiguration(ConfigFilePath);
checkBoxList = new CheckBoxPairList();
// Create Groupboxes and CheckBoxis //
foreach (var group in config.NodeTypeGroupList)
{
GroupBox gb = new GroupBox();
gb.Header = group.Name;
StackPanel sp = new StackPanel();
foreach (var visibleInfo in group.NodeTypeList)
{
CheckBox cb = new CheckBox();
cb.Content = visibleInfo.Left;
cb.IsChecked = visibleInfo.Right;
sp.Children.Add(cb);
checkBoxList.Add(new CheckBoxPair { Left = visibleInfo, Right = cb });
}
gb.Content = sp;
MainWrapPanel.Children.Add(gb);
}
}
开发者ID:hunpody,项目名称:psimulex,代码行数:28,代码来源:SyntaxTreeConfigurationWindow.xaml.cs
示例3: FrameBackend
public FrameBackend()
{
ExGrid grid = new ExGrid();
grid.Children.Add (this.groupBox = new SWC.GroupBox ());
grid.Children.Add (this.flippedGroupBox = new SWC.GroupBox ());
groupBox.SizeChanged += delegate (object sender, SizeChangedEventArgs e)
{
flippedGroupBox.RenderSize = groupBox.RenderSize;
};
this.flippedGroupBox.SetBinding (UIElement.IsEnabledProperty, new Binding ("IsEnabled") { Source = this.groupBox });
this.flippedGroupBox.SetBinding (Control.BorderBrushProperty, new Binding ("BorderBrush") { Source = this.groupBox });
this.flippedGroupBox.SetBinding (Control.BorderThicknessProperty,
new Binding ("BorderThickness") {
Source = this.groupBox,
Converter = new HFlippedBorderThicknessConverter ()
});
this.flippedGroupBox.RenderTransformOrigin = new System.Windows.Point (0.5, 0.5);
this.flippedGroupBox.RenderTransform = new ScaleTransform (-1, 1);
this.flippedGroupBox.Focusable = false;
SWC.Panel.SetZIndex (this.flippedGroupBox, -1);
Widget = grid;
}
开发者ID:nite2006,项目名称:xwt,代码行数:25,代码来源:FrameBackend.cs
示例4: InitWeekGrid
private void InitWeekGrid()
{
_lessonControls = new Dictionary<string, LessonControl[]>();
weekGrid.Children.Clear();
var weekDays = new List<string>() { "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота" };
foreach (var day in weekDays)
{
_lessonControls[day] = new LessonControl[8];
var groupBox = new GroupBox
{
Header = day,
Margin = new Thickness(5, 5, 5, 10),
BorderThickness = new Thickness(1),
Foreground = new SolidColorBrush((Color)FindResource("AccentColor")),
BorderBrush = new SolidColorBrush((Color)FindResource("AccentColor"))
};
weekGrid.Children.Add(groupBox);
Grid.SetColumn(groupBox, weekDays.IndexOf(day));
var lessonsGrid = new UniformGrid
{
Rows = 8,
Columns = 1,
Margin = new Thickness(0, 4, 0, 4)
};
for (var i = 0; i < 8; i++)
{
var lessonControl = new LessonControl();
lessonsGrid.Children.Add(lessonControl);
_lessonControls[day][i] = lessonControl;
}
groupBox.Content = lessonsGrid;
}
}
开发者ID:zaitsev-yury-350502,项目名称:BSUIR-Timetable,代码行数:35,代码来源:MainWindowN.xaml.cs
示例5: CreateHelpTopicControls
private GroupBox CreateHelpTopicControls(string Name, Dictionary<string, string> HelpTopics)
{
GroupBox topicGroupBox = new GroupBox();
Label topicHeader = new Label();
topicHeader.FontSize = 20;
topicHeader.Content = Name;
StackPanel topicStackPanel = new StackPanel();
topicGroupBox.Header = topicHeader;
topicGroupBox.Margin = new Thickness(10);
foreach (KeyValuePair<string, string> kvp in HelpTopics)
{
Label topicTitle = new Label();
topicTitle.FontSize = 14;
topicTitle.Content = kvp.Key;
TextBlock topic = new TextBlock();
topic.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
topic.Margin = new Thickness(20, 10, 10, 10);
topic.Width = 1000;
topic.TextWrapping = TextWrapping.Wrap;
topic.Text = kvp.Value;
topicStackPanel.Children.Add(topicTitle);
topicStackPanel.Children.Add(topic);
}
topicGroupBox.Content = topicStackPanel;
return topicGroupBox;
}
开发者ID:KyleBerryCS,项目名称:Portfolio,代码行数:26,代码来源:HelpPageView.xaml.cs
示例6: AddHistogram
public void AddHistogram (Histogram histogram)
{
GroupBox groupBox = new GroupBox();
MainPanel.Children.Add(groupBox);
groupBox.Header = "Xray Image " + MainPanel.Children.Count.ToString();
groupBox.Content = histogram;
}
开发者ID:BdGL3,项目名称:CXPortal,代码行数:8,代码来源:HistogramDisplay.xaml.cs
示例7: GetGroupBox
private static GroupBox GetGroupBox(string header, object content)
{
GroupBox groupBox = new GroupBox();
groupBox.Header = header;
groupBox.Content = content;
groupBox.SnapsToDevicePixels = true;
groupBox.Margin = new Thickness(0, 1, 0, 0);
return groupBox;
}
开发者ID:Genotoxicity,项目名称:TableOfConnections,代码行数:9,代码来源:UI.cs
示例8: BinarySelector
public BinarySelector(int number)
{
BitNumber = number;
Orientation = Orientation.Vertical;
HorizontalAlignment = HorizontalAlignment.Stretch;
VerticalAlignment = VerticalAlignment.Center;
var gb = new GroupBox {Header = BitNumber.ToString(CultureInfo.InvariantCulture)};
CheckBox = new CheckBox {IsChecked = false};
gb.Content = CheckBox;
Children.Add(gb);
}
开发者ID:KurlesHS,项目名称:SimpleBinaryCalculator,代码行数:11,代码来源:MainWindow.xaml.cs
示例9: DocUISubSection
/// <summary>
/// Creates a new instance of the SubSectionOption
/// </summary>
/// <param name="xmlNode">The xmlnode containing the data.</param>
/// <param name="xsdNode">The corresponding xsdNode.</param>
/// <param name="panel">The panel on which this option should be placed.</param>
/// <param name="parentForm">The form of which this option is a part.</param>
public DocUISubSection(XmlNode xmlNode, XmlSchemaAnnotated xsdNode, Panel contentpanel, Panel overlaypanel, DynamicForm parentForm) :
base(xmlNode, xsdNode, contentpanel, overlaypanel, parentForm)
{
XmlSchemaElement schemaEl = xsdNode as XmlSchemaElement;
if (schemaEl != null)
{
optionlist = new List<AbstractDocUIComponent>();
box = new GroupBox();
DockPanel panel = new DockPanel();
Grid g = new Grid() { Margin = new Thickness(5, 0, 0, 0) };
g.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Auto) });
g.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) });
XmlSchemaSequence seq = XmlSchemaUtilities.tryGetSequence(schemaEl.ElementSchemaType);
if (seq != null)
{
foreach (XmlSchemaElement el in seq.Items)
Utilities.recursive(el, xmlNode.SelectSingleNode(el.Name), g, overlaypanel, (comp) =>
{
comp.placeOption();
optionlist.Add(comp);
}, parentForm);
}
if (xmlNode.Attributes["checked"] != null)
{
check = new CheckBox() { Margin = new Thickness(5, 5, 0, 5) };
check.Checked += check_changed;
check.Checked += (s, e) => { hasPendingChanges(); };
check.Unchecked += check_changed;
check.Unchecked += (s, e) => { hasPendingChanges(); };
panel.Children.Add(check);
}
// if there is no label, there should be no groupbox.
if (Label.Text != "")
{
panel.Children.Add(Label);
box.Header = panel;
box.Content = g;
Control = box;
}
else
{
panel.Children.Add(g);
//Control = g;
Control = panel;
}
setup();
}
}
开发者ID:00Green27,项目名称:DocUI,代码行数:60,代码来源:DocUISubSection.cs
示例10: switch
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
this.groupBoxNew = ((System.Windows.Controls.GroupBox)(target));
return;
case 2:
this.border1 = ((System.Windows.Controls.Border)(target));
return;
}
this._contentLoaded = true;
}
开发者ID:BodySplash,项目名称:Nabazplayer,代码行数:12,代码来源:NewNabaztagView.g.cs
示例11: GetGUIElement
public override FrameworkElement GetGUIElement()
{
var box = new GroupBox();
var textBox = new TextBox { Text = Value };
textBox.TextChanged += (sender, args) =>
{ Value = textBox.Text; };
box.Header = WpfName;
box.Content = textBox;
return box;
}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:14,代码来源:StringParam.cs
示例12: RenderInformationAboutSphinx
/// <summary>
/// Display information about the state of Sphinx.
/// </summary>
/// <param name="sphinxIsStarted">The flag to check launched Sphinx.</param>
/// <param name="lblSphinx">Label where to display information.</param>
/// <param name="grpSearch">GroupBox which must be unlocked.</param>
/// <param name="txtSearchResult">TextBox which must be unlocked.</param>
public void RenderInformationAboutSphinx(bool sphinxIsStarted, Label lblSphinx, GroupBox grpSearch, TextBox txtSearchResult)
{
if (sphinxIsStarted)
{
lblSphinx.Content = "Sphinx: It works!";
lblSphinx.Foreground = new SolidColorBrush(Color.FromArgb(0xFF, 0x00, 0xB4, 0x00));
}
else
{
lblSphinx.Content = "Sphinx: Does not work!";
lblSphinx.Foreground = new SolidColorBrush(Color.FromArgb(0xFF, 0xFF, 0x00, 0x00));
grpSearch.IsEnabled = false;
txtSearchResult.IsEnabled = false;
}
}
开发者ID:7BF794B0,项目名称:EntityFrameworkTestApplication,代码行数:22,代码来源:View.cs
示例13: GetCheckedRadioButton
public static RadioButton GetCheckedRadioButton(GroupBox grpbox)
{
Panel pnl = grpbox.Content as Panel;
if (pnl != null)
{
foreach (UIElement el in pnl.Children)
{
RadioButton radio = el as RadioButton;
if (radio != null && (bool)radio.IsChecked)
return radio;
}
}
return null;
}
开发者ID:gawallsibya,项目名称:BIT_MFC-CShap-DotNet,代码行数:16,代码来源:Vitals.cs
示例14: MetroWindow_Loaded
private void MetroWindow_Loaded(object sender, RoutedEventArgs e)
{
var s = new Style();
s.Setters.Add(new Setter(VisibilityProperty, Visibility.Collapsed));
View.MainWindowTC.ItemContainerStyle = s;
Entry.Instance.Plugins.LoadPlugins(Directory.GetCurrentDirectory() + @"\Plugins");
foreach (PluginInstance v in Entry.Instance.Plugins.Loaded)
{
var groupbox = new GroupBox {Header = v.Instance.Name};
var sp = new StackPanel {Name = Name = v.Instance.Name + "PI"};
sp.Children.Add(new Label {Content = String.Format("Description: {0}", v.Instance.Description)});
sp.Children.Add(new Label {Content = String.Format("Author: {0}", v.Instance.Author)});
sp.Children.Add(new Label {Content = String.Format("Version: {0}", v.Instance.Version)});
groupbox.Content = sp;
PluginsView.Contents.Children.Add(groupbox);
}
}
开发者ID:Icehunter,项目名称:plugin-interface-host,代码行数:18,代码来源:MainWindow.xaml.cs
示例15: switch
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
switch (connectionId)
{
case 1:
this.gb = ((System.Windows.Controls.GroupBox)(target));
return;
case 2:
this.lv_Sets = ((System.Windows.Controls.ListView)(target));
#line 13 "..\..\..\..\Controls\Visualizers\ListSetsVisualizer.xaml"
this.lv_Sets.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(this.lv_Sets_SelectionChanged);
#line default
#line hidden
return;
}
this._contentLoaded = true;
}
开发者ID:svegapons,项目名称:clustering_ensemble_suite,代码行数:18,代码来源:ListSetsVisualizer.g.cs
示例16: CreateStatus
protected void CreateStatus()
{
this.wrap_Status.Height = 0;
foreach (Stat item in Stats.DefaultPersonStatusItems.Where(e => e.Type == "status"))
{
GroupBox box = new GroupBox();
box.Width = this.wrap_Status.Width - 20;
box.VerticalAlignment = VerticalAlignment.Top;
box.Header = item.Name;
this.wrap_Status.Children.Add(box);
Grid grid = new Grid();
grid.VerticalAlignment = VerticalAlignment.Top;
box.Content = grid;
if (item.ControlType == typeof(ProgressBar))
{
ProgressBar value = (ProgressBar)item.GetControlInstance();
value.Margin = new Thickness(0, 2, 0, 0);
value.Name = "pgb_" + item.Name;
value.Height = 14;
ToolTip tip = new System.Windows.Controls.ToolTip();
tip.Content = "0";
value.ToolTip = tip;
grid.Children.Add(value);
}
else if (item.ControlType == typeof(CheckBox))
{
CheckBox value = (CheckBox)item.GetControlInstance();
value.Margin = new Thickness(0, 2, 0, 0);
value.Name = "chk_" + item.Name;
value.Height = 14;
value.IsEnabled = false;
grid.Children.Add(value);
}
this.wrap_Status.Height += box.Height;
}
}
开发者ID:Tragedian-HLife,项目名称:HLife,代码行数:44,代码来源:PersonInformationWindow.xaml.cs
示例17: TuneTheRadio
public TuneTheRadio()
{
Title = "Tune the Radio";
SizeToContent = SizeToContent.WidthAndHeight;
GroupBox group = new GroupBox();
group.Header = "Window Style";
group.Margin = new Thickness(96);
group.Padding = new Thickness(5);
Content = group;
StackPanel stack = new StackPanel();
group.Content = stack;
stack.Children.Add(CreateRadioButton("No border or caption", WindowStyle.None));
stack.Children.Add(CreateRadioButton("Single-border window", WindowStyle.SingleBorderWindow));
stack.Children.Add(CreateRadioButton("3D-border window", WindowStyle.ThreeDBorderWindow));
stack.Children.Add(CreateRadioButton("Tool window", WindowStyle.ToolWindow));
AddHandler(RadioButton.CheckedEvent, new RoutedEventHandler(RadioOnChecked));
}
开发者ID:JianchengZh,项目名称:kasicass,代码行数:20,代码来源:TuneTheRadio.cs
示例18: foreach
public void SetzeFächer(IEnumerable<Fach> fächer) {
var aufgabenfelder = from fach in fächer group fach by fach.Aufgabenfeld;
foreach (var aufgabenfeld in aufgabenfelder) {
var groupBox = new GroupBox {
Header = aufgabenfeld.Key
};
var stackPanel = new StackPanel();
groupBox.Content = stackPanel;
mainStackPanel.Children.Add(groupBox);
foreach (var fach in aufgabenfeld) {
var checkBox = new CheckBox {
Content = fach.Bezeichnung,
Tag = fach.Id
};
checkBoxes.Add(checkBox);
stackPanel.Children.Add(checkBox);
}
}
}
开发者ID:slieser,项目名称:sandbox2,代码行数:21,代码来源:MainWindow.xaml.cs
示例19: initDebugLog
private void initDebugLog()
{
debugLogTextBox = new TextBox();
debugLogTextBox.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;
debugLogTextBox.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
debugLogTextBox.IsReadOnly = true;
debugLogTextBox.FontFamily = new System.Windows.Media.FontFamily("Courier New");
debugLogTextBox.FontSize = 10.667;
RowDefinition rowDef = new RowDefinition();
rowDef.Height = new GridLength(80);
// current count is new index ==> (current max-index) + 1 ==> (count-1)+1 ==> count
int rowIndex = mainGrid.RowDefinitions.Count;
mainGrid.RowDefinitions.Add(rowDef);
GroupBox debugGroupBox = new GroupBox();
debugGroupBox.SetValue(Grid.RowProperty, rowIndex);
debugGroupBox.Header = "Debug Log";
debugGroupBox.Content = debugLogTextBox;
mainGrid.Children.Add(debugGroupBox);
}
开发者ID:omkelderman,项目名称:mbed-Deploy-Tool,代码行数:22,代码来源:MainWindow.xaml.cs
示例20: FrameBackend
public FrameBackend()
{
ExGrid grid = new ExGrid();
grid.Children.Add (this.groupBox = new SWC.GroupBox ());
grid.Children.Add (this.flippedGroupBox = new SWC.GroupBox ());
this.flippedGroupBox.SetBinding (FrameworkElement.WidthProperty, new Binding ("ActualWidth") { Source = this.groupBox });
this.flippedGroupBox.SetBinding (FrameworkElement.HeightProperty, new Binding ("ActualHeight") { Source = this.groupBox });
this.flippedGroupBox.SetBinding (UIElement.IsEnabledProperty, new Binding ("IsEnabled") { Source = this.groupBox });
this.flippedGroupBox.SetBinding (Control.BorderBrushProperty, new Binding ("BorderBrush") { Source = this.groupBox });
this.flippedGroupBox.SetBinding (Control.BorderThicknessProperty,
new Binding ("BorderThickness") {
Source = this.groupBox,
Converter = new HFlippedBorderThicknessConverter ()
});
this.flippedGroupBox.RenderTransformOrigin = new System.Windows.Point (0.5, 0.5);
this.flippedGroupBox.RenderTransform = new ScaleTransform (-1, 1);
this.flippedGroupBox.Focusable = false;
SWC.Panel.SetZIndex (this.flippedGroupBox, -1);
Widget = grid;
}
开发者ID:antonydenyer,项目名称:xwt,代码行数:23,代码来源:FrameBackend.cs
注:本文中的System.Windows.Controls.GroupBox类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论