本文整理汇总了C#中System.Windows.Controls.GroupBox类的典型用法代码示例。如果您正苦于以下问题:C# GroupBox类的具体用法?C# GroupBox怎么用?C# GroupBox使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GroupBox类属于System.Windows.Controls命名空间,在下文中一共展示了GroupBox类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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);
}
}
示例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;
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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();
}
}
示例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;
}
示例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;
}
示例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;
}
}
示例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;
}
示例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);
}
}
示例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;
}