private void CrearMenuSuperior() { gridPrincipal.Children.Add(crearNewChart, 0, 0); CustomCheckBox customCheckBox = new CustomCheckBox(); //gridPrincipal.Children.Add(new CustomButtonShowMenuInferior(), 0, 1); gridPrincipal.Children.Add(customCheckBox, 0, 1); }
private static void ScaledTransformResult(CustomCheckBox customCheckBox, DependencyPropertyChangedEventArgs e) { var border = customCheckBox.Template?.FindName("PART_Border", customCheckBox) as Border; ScaleTransform scaleTransform = new ScaleTransform(); scaleTransform.ScaleX = (double)e.NewValue / StandardSize; scaleTransform.ScaleY = (double)e.NewValue / StandardSize; border.RenderTransform = scaleTransform; }
public CustomCheckBoxAdapter(CustomCheckBoxRenderer renderer) { Verify.Argument.IsNotNull(renderer, "renderer"); _checkBox = new CustomCheckBox() { Renderer = renderer, }; _checkBox.IsCheckedChanged += OnCheckBoxIsCheckedChanged; _checkBox.CheckStateChanged += OnCheckBoxCheckStateChanged; }
public UIElement Visit(Evaluation.Values.Bool value) { CustomCheckBox customCheckBox = new CustomCheckBox() { Name = uiElementId, IsChecked = value.GetValue(), IsEnabled = !isReadOnly }; customCheckBox.EventUpdateValue += UpdateValue; return(customCheckBox); }
public override void _Ready() { infiniteCompounds = GetNode <CustomCheckBox>(InfiniteCompoundsPath); godMode = GetNode <CustomCheckBox>(GodModePath); disableAI = GetNode <CustomCheckBox>(DisableAIPath); speed = GetNode <Slider>(SpeedSliderPath); playerDivide = GetNode <Button>(PlayerDividePath); spawnEnemy = GetNode <Button>(SpawnEnemyPath); playerDivide.Connect("pressed", this, nameof(OnPlayerDivideClicked)); spawnEnemy.Connect("pressed", this, nameof(OnSpawnEnemyClicked)); base._Ready(); }
public void AddItem(CleanerItemUIInfo itemInfo) { var newControl = new CustomCheckBox() { Text = itemInfo.Name, Info = itemInfo, Dock = DockStyle.Top, Margin = new Padding(0), Padding = new Padding(0), }; this.Controls.Add(newControl); }
public Form2() { InitializeComponent(); CustomCheckBox.CheckChanged += (object sender, EventArgs e) => { if (sender != m_customCheckBox) { m_customCheckBox.Checked = CustomCheckBox.GetCheck(); } }; FormClosed += (object _sender, FormClosedEventArgs _e) => { CustomCheckBox.CheckChanged -= (object __sender, EventArgs __e) => { }; }; }
public void AddItem(CleanerItemUIInfo itemInfo) { var newControl = new CustomCheckBox() { Text = itemInfo.Name, Info = itemInfo, Margin = new Padding(0), Padding = new Padding(0), MaximumSize = new System.Drawing.Size(460, 0), AutoSize = true, Dock = DockStyle.Top, }; Controls.Add(newControl); }
public void AddEmployees(bool isShow) { if (isShow) { EmployeesPanel.Controls.Clear(); List <User> users = GetUndefinedUsers(); foreach (User user in users) { CustomCheckBox box = new CustomCheckBox(this); //box.CheckedChanged += customCheckBox_CheckedChanged; box.Title = user.Name + " " + user.Surname; box.UserBox = user.Login; EmployeesPanel.Controls.Add(box); EmployeesPanel.Visible = true; } } else { EmployeesPanel.Visible = false; } }
public abstract void Render(Graphics graphics, Rectangle clipRectangle, CustomCheckBox checkBox);
public override void _Ready() { infiniteMp = GetNode <CustomCheckBox>(InfiniteMpPath); base._Ready(); }
private void InitializeComponent() { ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof (ApplicationTabPanel)); this.ApplicationTabPanel_ShowComputerIsEnabledForWiMAXPopupChkBox = new CustomCheckBox(); this.ApplicationTabPanel_ShowSubscribeForServiceAndFirewallPopupChkBox = new CustomCheckBox(); this.ApplicationTabPanel_ShowCoExPopupsChkBox = new CustomCheckBox(); this.ApplicationTabPanel_ApplicationSettingsLabelSeparator = new CustomLabelSeparator(); this.ApplicationTabPanel_ShowActiveRoutesPopupChkBox = new CustomCheckBox(); this.ApplicationTabPanel_ShowDualModeWarningPopupChkBox = new CustomCheckBox(); this.SuspendLayout(); componentResourceManager.ApplyResources((object) this.ApplicationTabPanel_ShowComputerIsEnabledForWiMAXPopupChkBox, "ApplicationTabPanel_ShowComputerIsEnabledForWiMAXPopupChkBox"); this.ApplicationTabPanel_ShowComputerIsEnabledForWiMAXPopupChkBox.BackColor = Color.Transparent; this.ApplicationTabPanel_ShowComputerIsEnabledForWiMAXPopupChkBox.ButtonBitmapDisabled = (Bitmap) componentResourceManager.GetObject("ApplicationTabPanel_ShowComputerIsEnabledForWiMAXPopupChkBox.ButtonBitmapDisabled"); this.ApplicationTabPanel_ShowComputerIsEnabledForWiMAXPopupChkBox.ButtonBitmapNormal = (Bitmap) componentResourceManager.GetObject("ApplicationTabPanel_ShowComputerIsEnabledForWiMAXPopupChkBox.ButtonBitmapNormal"); this.ApplicationTabPanel_ShowComputerIsEnabledForWiMAXPopupChkBox.ButtonBitmapPressed = (Bitmap) componentResourceManager.GetObject("ApplicationTabPanel_ShowComputerIsEnabledForWiMAXPopupChkBox.ButtonBitmapPressed"); this.ApplicationTabPanel_ShowComputerIsEnabledForWiMAXPopupChkBox.ButtonBitmapRollover = (Bitmap) componentResourceManager.GetObject("ApplicationTabPanel_ShowComputerIsEnabledForWiMAXPopupChkBox.ButtonBitmapRollover"); this.ApplicationTabPanel_ShowComputerIsEnabledForWiMAXPopupChkBox.Checked = false; this.ApplicationTabPanel_ShowComputerIsEnabledForWiMAXPopupChkBox.Name = "ApplicationTabPanel_ShowComputerIsEnabledForWiMAXPopupChkBox"; componentResourceManager.ApplyResources((object) this.ApplicationTabPanel_ShowSubscribeForServiceAndFirewallPopupChkBox, "ApplicationTabPanel_ShowSubscribeForServiceAndFirewallPopupChkBox"); this.ApplicationTabPanel_ShowSubscribeForServiceAndFirewallPopupChkBox.BackColor = Color.Transparent; this.ApplicationTabPanel_ShowSubscribeForServiceAndFirewallPopupChkBox.ButtonBitmapDisabled = (Bitmap) componentResourceManager.GetObject("ApplicationTabPanel_ShowSubscribeForServiceAndFirewallPopupChkBox.ButtonBitmapDisabled"); this.ApplicationTabPanel_ShowSubscribeForServiceAndFirewallPopupChkBox.ButtonBitmapNormal = (Bitmap) componentResourceManager.GetObject("ApplicationTabPanel_ShowSubscribeForServiceAndFirewallPopupChkBox.ButtonBitmapNormal"); this.ApplicationTabPanel_ShowSubscribeForServiceAndFirewallPopupChkBox.ButtonBitmapPressed = (Bitmap) componentResourceManager.GetObject("ApplicationTabPanel_ShowSubscribeForServiceAndFirewallPopupChkBox.ButtonBitmapPressed"); this.ApplicationTabPanel_ShowSubscribeForServiceAndFirewallPopupChkBox.ButtonBitmapRollover = (Bitmap) componentResourceManager.GetObject("ApplicationTabPanel_ShowSubscribeForServiceAndFirewallPopupChkBox.ButtonBitmapRollover"); this.ApplicationTabPanel_ShowSubscribeForServiceAndFirewallPopupChkBox.Checked = false; this.ApplicationTabPanel_ShowSubscribeForServiceAndFirewallPopupChkBox.Name = "ApplicationTabPanel_ShowSubscribeForServiceAndFirewallPopupChkBox"; componentResourceManager.ApplyResources((object) this.ApplicationTabPanel_ShowCoExPopupsChkBox, "ApplicationTabPanel_ShowCoExPopupsChkBox"); this.ApplicationTabPanel_ShowCoExPopupsChkBox.BackColor = Color.Transparent; this.ApplicationTabPanel_ShowCoExPopupsChkBox.ButtonBitmapDisabled = (Bitmap) componentResourceManager.GetObject("ApplicationTabPanel_ShowCoExPopupsChkBox.ButtonBitmapDisabled"); this.ApplicationTabPanel_ShowCoExPopupsChkBox.ButtonBitmapNormal = (Bitmap) componentResourceManager.GetObject("ApplicationTabPanel_ShowCoExPopupsChkBox.ButtonBitmapNormal"); this.ApplicationTabPanel_ShowCoExPopupsChkBox.ButtonBitmapPressed = (Bitmap) componentResourceManager.GetObject("ApplicationTabPanel_ShowCoExPopupsChkBox.ButtonBitmapPressed"); this.ApplicationTabPanel_ShowCoExPopupsChkBox.ButtonBitmapRollover = (Bitmap) componentResourceManager.GetObject("ApplicationTabPanel_ShowCoExPopupsChkBox.ButtonBitmapRollover"); this.ApplicationTabPanel_ShowCoExPopupsChkBox.Checked = false; this.ApplicationTabPanel_ShowCoExPopupsChkBox.Name = "ApplicationTabPanel_ShowCoExPopupsChkBox"; this.ApplicationTabPanel_ApplicationSettingsLabelSeparator.BackColor = Color.White; componentResourceManager.ApplyResources((object) this.ApplicationTabPanel_ApplicationSettingsLabelSeparator, "ApplicationTabPanel_ApplicationSettingsLabelSeparator"); this.ApplicationTabPanel_ApplicationSettingsLabelSeparator.Name = "ApplicationTabPanel_ApplicationSettingsLabelSeparator"; this.ApplicationTabPanel_ApplicationSettingsLabelSeparator.TabStop = false; componentResourceManager.ApplyResources((object) this.ApplicationTabPanel_ShowActiveRoutesPopupChkBox, "ApplicationTabPanel_ShowActiveRoutesPopupChkBox"); this.ApplicationTabPanel_ShowActiveRoutesPopupChkBox.BackColor = Color.Transparent; this.ApplicationTabPanel_ShowActiveRoutesPopupChkBox.ButtonBitmapDisabled = (Bitmap) componentResourceManager.GetObject("ApplicationTabPanel_ShowActiveRoutesPopupChkBox.ButtonBitmapDisabled"); this.ApplicationTabPanel_ShowActiveRoutesPopupChkBox.ButtonBitmapNormal = (Bitmap) componentResourceManager.GetObject("ApplicationTabPanel_ShowActiveRoutesPopupChkBox.ButtonBitmapNormal"); this.ApplicationTabPanel_ShowActiveRoutesPopupChkBox.ButtonBitmapPressed = (Bitmap) componentResourceManager.GetObject("ApplicationTabPanel_ShowActiveRoutesPopupChkBox.ButtonBitmapPressed"); this.ApplicationTabPanel_ShowActiveRoutesPopupChkBox.ButtonBitmapRollover = (Bitmap) componentResourceManager.GetObject("ApplicationTabPanel_ShowActiveRoutesPopupChkBox.ButtonBitmapRollover"); this.ApplicationTabPanel_ShowActiveRoutesPopupChkBox.Checked = false; this.ApplicationTabPanel_ShowActiveRoutesPopupChkBox.Name = "ApplicationTabPanel_ShowActiveRoutesPopupChkBox"; componentResourceManager.ApplyResources((object) this.ApplicationTabPanel_ShowDualModeWarningPopupChkBox, "ApplicationTabPanel_ShowDualModeWarningPopupChkBox"); this.ApplicationTabPanel_ShowDualModeWarningPopupChkBox.BackColor = Color.Transparent; this.ApplicationTabPanel_ShowDualModeWarningPopupChkBox.ButtonBitmapDisabled = (Bitmap) componentResourceManager.GetObject("ApplicationTabPanel_ShowDualModeWarningPopupChkBox.ButtonBitmapDisabled"); this.ApplicationTabPanel_ShowDualModeWarningPopupChkBox.ButtonBitmapNormal = (Bitmap) componentResourceManager.GetObject("ApplicationTabPanel_ShowDualModeWarningPopupChkBox.ButtonBitmapNormal"); this.ApplicationTabPanel_ShowDualModeWarningPopupChkBox.ButtonBitmapPressed = (Bitmap) componentResourceManager.GetObject("ApplicationTabPanel_ShowDualModeWarningPopupChkBox.ButtonBitmapPressed"); this.ApplicationTabPanel_ShowDualModeWarningPopupChkBox.ButtonBitmapRollover = (Bitmap) componentResourceManager.GetObject("ApplicationTabPanel_ShowDualModeWarningPopupChkBox.ButtonBitmapRollover"); this.ApplicationTabPanel_ShowDualModeWarningPopupChkBox.Checked = false; this.ApplicationTabPanel_ShowDualModeWarningPopupChkBox.Name = "ApplicationTabPanel_ShowDualModeWarningPopupChkBox"; this.BackColor = Color.White; this.Controls.Add((Control) this.ApplicationTabPanel_ShowDualModeWarningPopupChkBox); this.Controls.Add((Control) this.ApplicationTabPanel_ShowActiveRoutesPopupChkBox); this.Controls.Add((Control) this.ApplicationTabPanel_ShowComputerIsEnabledForWiMAXPopupChkBox); this.Controls.Add((Control) this.ApplicationTabPanel_ShowSubscribeForServiceAndFirewallPopupChkBox); this.Controls.Add((Control) this.ApplicationTabPanel_ShowCoExPopupsChkBox); this.Controls.Add((Control) this.ApplicationTabPanel_ApplicationSettingsLabelSeparator); componentResourceManager.ApplyResources((object) this, "$this"); this.Name = "ApplicationTabPanel"; this.ResumeLayout(false); }
public ClickListener(CustomCheckBox myCheckbox) { this._myCheckbox = myCheckbox; }
private void InitializeComponent() { ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof (CustomMessageBoxPanel)); this.BtnBox = new CustomButtonPushHorizBox(); this.Btn1 = new CustomButtonPush(); this.Btn2 = new CustomButtonPush(); this.Btn3 = new CustomButtonPush(); this.DontShowThisMessageAgainChkBox = new CustomCheckBox(); this.BtnBox.SuspendLayout(); this.SuspendLayout(); this.BtnBox.Controls.Add((Control) this.Btn1); this.BtnBox.Controls.Add((Control) this.Btn2); this.BtnBox.Controls.Add((Control) this.Btn3); componentResourceManager.ApplyResources((object) this.BtnBox, "BtnBox"); this.BtnBox.HorizontalJustification = HorizontalJustificationEnum.Right; this.BtnBox.Name = "BtnBox"; this.Btn1.BackColor = Color.Transparent; this.Btn1.BtnColor = PushButtonColorEnum.BlueGrey; this.Btn1.BtnDoubleEndCaps = false; this.Btn1.BtnEnabled = true; componentResourceManager.ApplyResources((object) this.Btn1, "Btn1"); this.Btn1.Name = "Btn1"; this.Btn2.BackColor = Color.Transparent; this.Btn2.BtnColor = PushButtonColorEnum.BlueGrey; this.Btn2.BtnDoubleEndCaps = false; this.Btn2.BtnEnabled = true; componentResourceManager.ApplyResources((object) this.Btn2, "Btn2"); this.Btn2.Name = "Btn2"; this.Btn3.BackColor = Color.Transparent; this.Btn3.BtnColor = PushButtonColorEnum.BlueGrey; this.Btn3.BtnDoubleEndCaps = false; this.Btn3.BtnEnabled = true; componentResourceManager.ApplyResources((object) this.Btn3, "Btn3"); this.Btn3.Name = "Btn3"; this.DontShowThisMessageAgainChkBox.BackColor = Color.Transparent; this.DontShowThisMessageAgainChkBox.ButtonBitmapDisabled = (Bitmap) componentResourceManager.GetObject("DontShowThisMessageAgainChkBox.ButtonBitmapDisabled"); this.DontShowThisMessageAgainChkBox.ButtonBitmapNormal = (Bitmap) componentResourceManager.GetObject("DontShowThisMessageAgainChkBox.ButtonBitmapNormal"); this.DontShowThisMessageAgainChkBox.ButtonBitmapPressed = (Bitmap) componentResourceManager.GetObject("DontShowThisMessageAgainChkBox.ButtonBitmapPressed"); this.DontShowThisMessageAgainChkBox.ButtonBitmapRollover = (Bitmap) componentResourceManager.GetObject("DontShowThisMessageAgainChkBox.ButtonBitmapRollover"); this.DontShowThisMessageAgainChkBox.Checked = false; componentResourceManager.ApplyResources((object) this.DontShowThisMessageAgainChkBox, "DontShowThisMessageAgainChkBox"); this.DontShowThisMessageAgainChkBox.Name = "DontShowThisMessageAgainChkBox"; this.AutoScaleMode = AutoScaleMode.None; this.BackColor = Color.White; this.Controls.Add((Control) this.BtnBox); this.Controls.Add((Control) this.DontShowThisMessageAgainChkBox); componentResourceManager.ApplyResources((object) this, "$this"); this.Name = "CustomMessageBoxPanel"; this.BtnBox.ResumeLayout(false); this.ResumeLayout(false); }
private void MainWindow1_Loaded(object sender, RoutedEventArgs e) { List<CustomCheckBox> TabItemList = new List<CustomCheckBox>(); TabItem T1 = new TabItem(); //Create The Tabs TabItem T2 = new TabItem(); T1.Header = "General"; // Label the Headers T2.Header = "Performance"; TC.Items.Add(T1); // Add Tabs TC.Items.Add(T2); // Grid genGrid = new Grid(); // Create Grid StackPanel GenSP = new StackPanel(); // Create CB CustomCheckBox CB1 = new CustomCheckBox(); CB1.Content = "This is my test"; CB1.RegLoc = @"HKEY_LOCAL_MACHINE"; CB1.Margin = new Thickness(5, 60, 310, 120); // Add Children to Grid //genGrid.Children.Add(CB1); //CreateDynamicWPFGrid(); CreateXAMLFile(); LoadXAML(); T1.Content = GenGrid; // Set Tabcontent to Grid }
public override void Render(Graphics graphics, Rectangle clipRectangle, CustomCheckBox checkBox) { const int CheckBoxSize = 16; using(var brush = new SolidBrush(checkBox.BackColor)) { graphics.FillRectangle(brush, clipRectangle); } bool highlight; Color foregroundColor; if(checkBox.Enabled) { highlight = checkBox.IsMouseOver || checkBox.Focused; foregroundColor = highlight ? ColorTable.ForegroundHighlight : ColorTable.Foreground; } else { highlight = false; foregroundColor = ColorTable.ForegroundDisabled; } var rcCheckBox = new Rectangle(1, 1 + (checkBox.Height - CheckBoxSize) / 2, CheckBoxSize - 2, CheckBoxSize - 2); using(var brush = new SolidBrush(highlight ? ColorTable.CheckBackgroundHighlight : ColorTable.CheckBackground)) { graphics.FillRectangle(brush, rcCheckBox); } rcCheckBox.X -= 1; rcCheckBox.Y -= 1; rcCheckBox.Width += 1; rcCheckBox.Height += 1; if(highlight) { using(var pen = new Pen(ColorTable.CheckHighlight)) { graphics.DrawRectangle(pen, rcCheckBox); } } switch(checkBox.CheckState) { case CheckState.Checked: { var path = new Point[] { new Point(4, 7 + rcCheckBox.Y), new Point(6, 10 + rcCheckBox.Y), new Point(11, 3 + rcCheckBox.Y), }; var mode = graphics.SmoothingMode; graphics.SmoothingMode = SmoothingMode.HighQuality; using(var pen = new Pen(foregroundColor, 1.7f)) { graphics.DrawLines(pen, path); } graphics.SmoothingMode = mode; } break; case CheckState.Indeterminate: { var rect = new Rectangle(rcCheckBox.X + 5, rcCheckBox.Y + 5, rcCheckBox.Width - 9, rcCheckBox.Height - 9); using(var brush = new SolidBrush(foregroundColor)) { graphics.FillRectangle(brush, rect); } } break; } int textOffset = 16; if(checkBox.Image != null) { var image = checkBox.Image; textOffset += image.Width + 4; graphics.DrawImage(image, new Rectangle(16 + 3, (checkBox.Height - image.Height) / 2, image.Width, image.Height)); } var text = checkBox.Text; if(!string.IsNullOrWhiteSpace(text)) { TextRenderer.DrawText( graphics, text, checkBox.Font, new Rectangle(textOffset, 0, checkBox.Width - textOffset, checkBox.Height), foregroundColor, TextFormatFlags.VerticalCenter | TextFormatFlags.EndEllipsis); } }
private void InitializeComponent() { ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof (TaskbarTabPanel)); this.TaskbarTabPanel_ShowTasktrayNotificationsChkBox = new CustomCheckBox(); this.TaskbarTabPanel_HowToLaunchCULabel = new Label(); this.TaskbarTabPanel_TaskbarSettingsLabelSeparator = new CustomLabelSeparator(); this.TaskbarTabPanel_ShowSystemTrayIconChkBox = new CustomCheckBox(); this.SuspendLayout(); componentResourceManager.ApplyResources((object) this.TaskbarTabPanel_ShowTasktrayNotificationsChkBox, "TaskbarTabPanel_ShowTasktrayNotificationsChkBox"); this.TaskbarTabPanel_ShowTasktrayNotificationsChkBox.BackColor = Color.Transparent; this.TaskbarTabPanel_ShowTasktrayNotificationsChkBox.ButtonBitmapDisabled = (Bitmap) componentResourceManager.GetObject("TaskbarTabPanel_ShowTasktrayNotificationsChkBox.ButtonBitmapDisabled"); this.TaskbarTabPanel_ShowTasktrayNotificationsChkBox.ButtonBitmapNormal = (Bitmap) componentResourceManager.GetObject("TaskbarTabPanel_ShowTasktrayNotificationsChkBox.ButtonBitmapNormal"); this.TaskbarTabPanel_ShowTasktrayNotificationsChkBox.ButtonBitmapPressed = (Bitmap) componentResourceManager.GetObject("TaskbarTabPanel_ShowTasktrayNotificationsChkBox.ButtonBitmapPressed"); this.TaskbarTabPanel_ShowTasktrayNotificationsChkBox.ButtonBitmapRollover = (Bitmap) componentResourceManager.GetObject("TaskbarTabPanel_ShowTasktrayNotificationsChkBox.ButtonBitmapRollover"); this.TaskbarTabPanel_ShowTasktrayNotificationsChkBox.Checked = false; this.TaskbarTabPanel_ShowTasktrayNotificationsChkBox.Name = "TaskbarTabPanel_ShowTasktrayNotificationsChkBox"; this.TaskbarTabPanel_HowToLaunchCULabel.BackColor = Color.White; this.TaskbarTabPanel_HowToLaunchCULabel.ForeColor = Color.Black; componentResourceManager.ApplyResources((object) this.TaskbarTabPanel_HowToLaunchCULabel, "TaskbarTabPanel_HowToLaunchCULabel"); this.TaskbarTabPanel_HowToLaunchCULabel.Name = "TaskbarTabPanel_HowToLaunchCULabel"; this.TaskbarTabPanel_TaskbarSettingsLabelSeparator.BackColor = Color.White; componentResourceManager.ApplyResources((object) this.TaskbarTabPanel_TaskbarSettingsLabelSeparator, "TaskbarTabPanel_TaskbarSettingsLabelSeparator"); this.TaskbarTabPanel_TaskbarSettingsLabelSeparator.Name = "TaskbarTabPanel_TaskbarSettingsLabelSeparator"; this.TaskbarTabPanel_TaskbarSettingsLabelSeparator.TabStop = false; componentResourceManager.ApplyResources((object) this.TaskbarTabPanel_ShowSystemTrayIconChkBox, "TaskbarTabPanel_ShowSystemTrayIconChkBox"); this.TaskbarTabPanel_ShowSystemTrayIconChkBox.BackColor = Color.Transparent; this.TaskbarTabPanel_ShowSystemTrayIconChkBox.ButtonBitmapDisabled = (Bitmap) componentResourceManager.GetObject("TaskbarTabPanel_ShowSystemTrayIconChkBox.ButtonBitmapDisabled"); this.TaskbarTabPanel_ShowSystemTrayIconChkBox.ButtonBitmapNormal = (Bitmap) componentResourceManager.GetObject("TaskbarTabPanel_ShowSystemTrayIconChkBox.ButtonBitmapNormal"); this.TaskbarTabPanel_ShowSystemTrayIconChkBox.ButtonBitmapPressed = (Bitmap) componentResourceManager.GetObject("TaskbarTabPanel_ShowSystemTrayIconChkBox.ButtonBitmapPressed"); this.TaskbarTabPanel_ShowSystemTrayIconChkBox.ButtonBitmapRollover = (Bitmap) componentResourceManager.GetObject("TaskbarTabPanel_ShowSystemTrayIconChkBox.ButtonBitmapRollover"); this.TaskbarTabPanel_ShowSystemTrayIconChkBox.Checked = false; this.TaskbarTabPanel_ShowSystemTrayIconChkBox.Name = "TaskbarTabPanel_ShowSystemTrayIconChkBox"; this.BackColor = Color.White; this.Controls.Add((Control) this.TaskbarTabPanel_ShowTasktrayNotificationsChkBox); this.Controls.Add((Control) this.TaskbarTabPanel_HowToLaunchCULabel); this.Controls.Add((Control) this.TaskbarTabPanel_TaskbarSettingsLabelSeparator); this.Controls.Add((Control) this.TaskbarTabPanel_ShowSystemTrayIconChkBox); componentResourceManager.ApplyResources((object) this, "$this"); this.Name = "TaskbarTabPanel"; this.ResumeLayout(false); }
public override void _Ready() { // Options control buttons resetButton = GetNode <Button>(ResetButtonPath); saveButton = GetNode <Button>(SaveButtonPath); // Tab selector buttons graphicsButton = GetNode <Button>(GraphicsButtonPath); soundButton = GetNode <Button>(SoundButtonPath); performanceButton = GetNode <Button>(PerformanceButtonPath); inputsButton = GetNode <Button>(InputsButtonPath); miscButton = GetNode <Button>(MiscButtonPath); // Graphics graphicsTab = GetNode <Control>(GraphicsTabPath); vsync = GetNode <CustomCheckBox>(VSyncPath); fullScreen = GetNode <CustomCheckBox>(FullScreenPath); msaaResolution = GetNode <OptionButton>(MSAAResolutionPath); maxFramesPerSecond = GetNode <OptionButton>(MaxFramesPerSecondPath); colourblindSetting = GetNode <OptionButton>(ColourblindSettingPath); chromaticAberrationToggle = GetNode <CustomCheckBox>(ChromaticAberrationTogglePath); chromaticAberrationSlider = GetNode <Slider>(ChromaticAberrationSliderPath); displayAbilitiesHotBarToggle = GetNode <CustomCheckBox>(DisplayAbilitiesBarTogglePath); guiLightEffectsToggle = GetNode <CustomCheckBox>(GUILightEffectsTogglePath); // Sound soundTab = GetNode <Control>(SoundTabPath); masterVolume = GetNode <Slider>(MasterVolumePath); masterMuted = GetNode <CustomCheckBox>(MasterMutedPath); musicVolume = GetNode <Slider>(MusicVolumePath); musicMuted = GetNode <CustomCheckBox>(MusicMutedPath); ambianceVolume = GetNode <Slider>(AmbianceVolumePath); ambianceMuted = GetNode <CustomCheckBox>(AmbianceMutedPath); sfxVolume = GetNode <Slider>(SFXVolumePath); sfxMuted = GetNode <CustomCheckBox>(SFXMutedPath); guiVolume = GetNode <Slider>(GUIVolumePath); guiMuted = GetNode <CustomCheckBox>(GUIMutedPath); audioOutputDeviceSelection = GetNode <OptionButton>(AudioOutputDeviceSelectionPath); languageSelection = GetNode <OptionButton>(LanguageSelectionPath); resetLanguageButton = GetNode <Button>(ResetLanguageButtonPath); languageProgressLabel = GetNode <Label>(LanguageProgressLabelPath); LoadLanguages(); LoadAudioOutputDevices(); // Performance performanceTab = GetNode <Control>(PerformanceTabPath); cloudInterval = GetNode <OptionButton>(CloudIntervalPath); cloudResolutionTitle = GetNode <VBoxContainer>(CloudResolutionTitlePath); cloudResolution = GetNode <OptionButton>(CloudResolutionPath); runAutoEvoDuringGameplay = GetNode <CustomCheckBox>(RunAutoEvoDuringGameplayPath); detectedCPUCount = GetNode <Label>(DetectedCPUCountPath); activeThreadCount = GetNode <Label>(ActiveThreadCountPath); assumeHyperthreading = GetNode <CustomCheckBox>(AssumeHyperthreadingPath); useManualThreadCount = GetNode <CustomCheckBox>(UseManualThreadCountPath); threadCountSlider = GetNode <Slider>(ThreadCountSliderPath); // Inputs inputsTab = GetNode <Control>(InputsTabPath); inputGroupList = GetNode <InputGroupList>(InputGroupListPath); inputGroupList.OnControlsChanged += OnControlsChanged; // Misc miscTab = GetNode <Control>(MiscTabPath); playIntro = GetNode <CustomCheckBox>(PlayIntroPath); playMicrobeIntro = GetNode <CustomCheckBox>(PlayMicrobeIntroPath); tutorialsEnabledOnNewGame = GetNode <CustomCheckBox>(TutorialsEnabledOnNewGamePath); cheats = GetNode <CustomCheckBox>(CheatsPath); autoSave = GetNode <CustomCheckBox>(AutoSavePath); maxAutoSaves = GetNode <SpinBox>(MaxAutoSavesPath); maxQuickSaves = GetNode <SpinBox>(MaxQuickSavesPath); tutorialsEnabled = GetNode <CustomCheckBox>(TutorialsEnabledPath); customUsernameEnabled = GetNode <CustomCheckBox>(CustomUsernameEnabledPath); customUsername = GetNode <LineEdit>(CustomUsernamePath); jsonDebugMode = GetNode <OptionButton>(JSONDebugModePath); unsavedProgressWarningEnabled = GetNode <CustomCheckBox>(UnsavedProgressWarningPath); screenshotDirectoryWarningBox = GetNode <CustomConfirmationDialog>(ScreenshotDirectoryWarningBoxPath); backConfirmationBox = GetNode <CustomDialog>(BackConfirmationBoxPath); defaultsConfirmationBox = GetNode <CustomConfirmationDialog>(DefaultsConfirmationBoxPath); errorAcceptBox = GetNode <ErrorDialog>(ErrorAcceptBoxPath); selectedOptionsTab = SelectedOptionsTab.Graphics; cloudResolutionTitle.RegisterToolTipForControl("cloudResolution", "options"); guiLightEffectsToggle.RegisterToolTipForControl("guiLightEffects", "options"); assumeHyperthreading.RegisterToolTipForControl("assumeHyperthreading", "options"); unsavedProgressWarningEnabled.RegisterToolTipForControl("unsavedProgressWarning", "options"); }
/// <summary> /// On creating the view controller for a specific recordId, the form is checked to see which parameters are required, and the relevant input fields are queued up for adding to the page. /// The relevant data is then extracted from the database for the specific field, and added as the initial value for that field. /// </summary> /// <param name="recId">recordID</param> public FormPageVM(int recId) { using (SQLiteConnection conn = new SQLiteConnection(Preferences.Get("databaseLocation", ""))) { //Get the record and its corresponding variable values var queriedrec = conn.GetWithChildren <Record>(recId); ReadOnly = queriedrec.readOnly; RecId = recId; var txts = queriedrec.texts; var nums = queriedrec.numerics; var bools = queriedrec.booleans; //Compile the GUID BDCGUIDtext = "<<BDC><" + queriedrec.recordId + ">>"; var formId = queriedrec.formId; var formTemp = conn.Table <Form>().Where(Form => Form.formId == formId).FirstOrDefault(); formType = conn.GetWithChildren <Form>(formTemp.Id); foreach (var formField in formType.formFields.OrderBy(f => f.order)) { var label = new Label(); if (formField.title != null && formField.title != String.Empty) { label.Text = formField.title; } else { label.Text = formField.description; } if (formField.mandatory) { label.Text = label.Text + " *"; } label.FontAttributes = FontAttributes.Bold; label.Margin = new Thickness(0, 10, 0, 0); label.SetAppThemeColor(Label.TextColorProperty, Color.Black, Color.White); if (formField.typeId != 31) //Add label next to checkbox for boolean { Assets.Add(label); } if (formField.typeId == 11 || formField.typeId == 61) { try { var text = conn.Table <TextData>().Select(t => t).Where(TextData => TextData.record_fk == RecId).Where(TextData => TextData.formFieldId == formField.fieldId).FirstOrDefault(); var textField = new CustomEntry(); if (text == null) { //CreateNew var txt = new TextData { textId = Guid.NewGuid().ToString(), title = String.Empty, value = String.Empty, formFieldId = formField.fieldId, record_fk = recId }; conn.Insert(txt); txts.Add(txt); queriedrec.texts = txts; conn.UpdateWithChildren(queriedrec); text = txt; } textField = new CustomEntry { Text = text.value.ToString() }; textField.Keyboard = Keyboard.Text; textField.Placeholder = formField.description; textField.ClearButtonVisibility = ClearButtonVisibility.WhileEditing; textField.ReturnType = ReturnType.Done; textField.Margin = new Thickness(0, 0, 0, 10); textField.ValueId = text.Id; textField.TypeId = formField.typeId; textField.TextChanged += TextFieldChanged; textField.IsEnabled = !ReadOnly; textField.Mandatory = formField.mandatory; var empty = String.IsNullOrEmpty(textField.Text); if (formField.mandatory) { Validation.Add((int)textField.ValueId, !empty); } if (ReadOnly) { textField.SetAppThemeColor(Label.BackgroundColorProperty, Color.FromRgb(0.95, 0.95, 0.95), Color.FromRgb(0.2, 0.2, 0.2)); } Assets.Add(textField); } catch (Exception e) { Console.WriteLine("Could not create field" + e); } } else if (formField.typeId == 41) { try { var text = conn.Table <TextData>().Select(t => t).Where(TextData => TextData.record_fk == RecId).Where(TextData => TextData.formFieldId == formField.fieldId).Take(1).FirstOrDefault(); var dateField = new CustomDatePicker(); var timeField = new CustomTimePicker(); var nowButton = new Button(); var clearButton = new Button(); var stack = new CustomStackLayout() { Orientation = StackOrientation.Horizontal, Children = { dateField, timeField, nowButton, clearButton } }; stack.WidthRequest = 350; stack.HorizontalOptions = LayoutOptions.Start; if (text == null) { //CreateNew var txt = new TextData { textId = Guid.NewGuid().ToString(), title = String.Empty, value = String.Empty, formFieldId = formField.fieldId, record_fk = recId }; conn.Insert(txt); txts.Add(txt); queriedrec.texts = txts; conn.UpdateWithChildren(queriedrec); text = txt; } List <string> choices = Form.FetchFormChoicesForDropdown(formField.fieldId); try { var dt = DateTime.ParseExact(text.value, "yyyy-MM-ddTHH:mm:sszzz", null); if (text.value != null && text.value != String.Empty) { dateField.NullableDate = dt.Date; timeField.NullableDate = new TimeSpan(dt.TimeOfDay.Hours, dt.TimeOfDay.Minutes, 0); } } catch (Exception exp) { Console.WriteLine(exp); } dateField.Margin = new Thickness(0, 0, 0, 10); dateField.ValueId = text.Id; dateField.TypeId = formField.typeId; dateField.Format = "dd MMMM yyyy"; dateField.IsEnabled = !ReadOnly; dateField.WidthRequest = 170; dateField.HeightRequest = 40; dateField.Mandatory = formField.mandatory; dateField.VerticalOptions = LayoutOptions.StartAndExpand; dateField.PropertyChanged += DateFieldChanged; var empty = (dateField.NullableDate == null); if (formField.mandatory) { Validation.Add((int)dateField.ValueId, !empty); } if (ReadOnly) { dateField.SetAppThemeColor(Label.BackgroundColorProperty, Color.FromRgb(0.95, 0.95, 0.95), Color.FromRgb(0.2, 0.2, 0.2)); } timeField.Margin = new Thickness(0, 0, 0, 0); timeField.ValueId = text.Id; timeField.TypeId = formField.typeId; timeField.Format = "HH:mm"; timeField.IsEnabled = !ReadOnly; timeField.WidthRequest = 70; timeField.HeightRequest = 40; timeField.VerticalOptions = LayoutOptions.StartAndExpand; timeField.Mandatory = formField.mandatory; timeField.PropertyChanged += TimeFieldChanged; if (ReadOnly) { timeField.SetAppThemeColor(Label.BackgroundColorProperty, Color.FromRgb(0.95, 0.95, 0.95), Color.FromRgb(0.2, 0.2, 0.2)); } Dictionary <String, Object> dic = new Dictionary <string, object>(); dic.Add("text", text); dic.Add("date", dateField); dic.Add("time", timeField); var nowCommand = new Command(FillOutDate); nowButton.Text = "JETZT"; nowButton.TextTransform = TextTransform.Uppercase; nowButton.FontSize = 12; nowButton.Style = (Style)Xamarin.Forms.Application.Current.Resources["TransparentButtonStyle"]; nowButton.Command = nowCommand; nowButton.CommandParameter = dic; nowButton.Margin = new Thickness(10, 0, 0, 0); nowButton.WidthRequest = 40; nowButton.HeightRequest = 40; nowButton.VerticalOptions = LayoutOptions.StartAndExpand; nowButton.IsVisible = !ReadOnly; var clearCommand = new Command(ClearDate); clearButton.Text = "ⓧ"; clearButton.FontSize = 20; clearButton.Style = (Style)Xamarin.Forms.Application.Current.Resources["TransparentButtonStyle"]; clearButton.Command = clearCommand; clearButton.CommandParameter = dic; clearButton.Margin = new Thickness(10, 0, 10, 0); clearButton.WidthRequest = 30; clearButton.HeightRequest = 40; clearButton.VerticalOptions = LayoutOptions.StartAndExpand; clearButton.IsVisible = !ReadOnly; stack.Margin = new Thickness(0, 0, 0, 10); stack.ValueId = text.Id; stack.TypeId = formField.typeId; Assets.Add(stack); } catch (Exception e) { Console.WriteLine("Could not create field" + e); } } else if (formField.typeId == 51) { try { var text = conn.Table <TextData>().Select(t => t).Where(TextData => TextData.record_fk == RecId).Where(TextData => TextData.formFieldId == formField.fieldId).Take(1).FirstOrDefault(); var textField = new CustomPicker(); if (text == null) { //CreateNew var txt = new TextData { textId = Guid.NewGuid().ToString(), title = String.Empty, value = String.Empty, formFieldId = formField.fieldId, record_fk = recId }; conn.Insert(txt); txts.Add(txt); queriedrec.texts = txts; conn.UpdateWithChildren(queriedrec); text = txt; } List <string> choices = Form.FetchFormChoicesForDropdown(formField.Id); textField.ItemsSource = choices; textField.ValueId = text.Id; textField.TypeId = formField.Id; textField.Title = formField.description; textField.IsEnabled = !ReadOnly; textField.Mandatory = formField.mandatory; if (formField.mandatory) { Validation.Add((int)textField.ValueId, textField.SelectedItem != null || (text.value != null && text.value != String.Empty)); } if (ReadOnly) { textField.SetAppThemeColor(Label.BackgroundColorProperty, Color.FromRgb(0.95, 0.95, 0.95), Color.FromRgb(0.2, 0.2, 0.2)); } textField.SelectedIndexChanged += DidSelectFromChoices; if (text.fieldChoiceId != null) { textField.SelectedIndex = choices.FindIndex(a => a.Contains(text.value)); if (textField.SelectedIndex == -1 && (text.value != null && text.value != String.Empty)) { textField.Title = text.value; } textField.SelectedItem = text.value; } else if (text.value != null && text.value != String.Empty) { textField.Title = text.value; } textField.Margin = new Thickness(0, 0, 0, 10); Assets.Add(textField); } catch (Exception e) { Console.WriteLine("Could not create field" + e); } } else if (formField.typeId == 21) { try { var num = conn.Table <NumericData>().Select(n => n).Where(NumericData => NumericData.record_fk == RecId).Where(NumericData => NumericData.formFieldId == formField.fieldId).Take(1).FirstOrDefault(); var textField = new CustomEntry(); if (num == null) { //CreateNew var nm = new NumericData { numericId = Guid.NewGuid().ToString(), title = String.Empty, value = null, formFieldId = formField.fieldId, record_fk = recId }; conn.Insert(nm); nums.Add(nm); queriedrec.texts = txts; conn.UpdateWithChildren(queriedrec); num = nm; } textField = new CustomEntry { Text = ((double)num.value).ToString("F", CultureInfo.CreateSpecificCulture("de-CH")) }; textField.Keyboard = Keyboard.Numeric; textField.ClearButtonVisibility = ClearButtonVisibility.WhileEditing; textField.ReturnType = ReturnType.Done; textField.Margin = new Thickness(0, 0, 0, 10); textField.ValueId = num.Id; textField.TypeId = formField.typeId; textField.IsEnabled = !ReadOnly; textField.Mandatory = formField.mandatory; var empty = String.IsNullOrEmpty(textField.Text); if (formField.mandatory) { Validation.Add((int)textField.ValueId, !empty); } if (ReadOnly) { textField.SetAppThemeColor(Label.BackgroundColorProperty, Color.FromRgb(0.95, 0.95, 0.95), Color.FromRgb(0.2, 0.2, 0.2)); } textField.TextChanged += NumericFieldChanged; Assets.Add(textField); } catch (Exception e) { Console.WriteLine("Could not create field" + e); } } else if (formField.typeId == 31) { try { var boolValue = conn.Table <BooleanData>().Select(n => n).Where(BooleanData => BooleanData.record_fk == RecId).Where(BooleanData => BooleanData.formFieldId == formField.fieldId).Take(1).FirstOrDefault(); var checkBox = new CustomCheckBox(); if (boolValue == null) { //CreateNew boolValue = new BooleanData { booleanId = Guid.NewGuid().ToString(), title = String.Empty, value = false, formFieldId = formField.fieldId, record_fk = recId }; conn.Insert(boolValue); bools.Add(boolValue); queriedrec.booleans = bools; conn.UpdateWithChildren(queriedrec); } if (boolValue != null) { checkBox.IsChecked = (bool)boolValue.value; } checkBox.Margin = new Thickness(0, 0, 0, 0); checkBox.ValueId = boolValue.Id; checkBox.TypeId = formField.typeId; checkBox.IsEnabled = !ReadOnly; if (ReadOnly) { checkBox.Color = Color.LightGray; } checkBox.CheckedChanged += BooleanFieldChanged; checkBox.VerticalOptions = LayoutOptions.Fill; checkBox.HorizontalOptions = LayoutOptions.Start; label.VerticalOptions = LayoutOptions.Fill; label.VerticalTextAlignment = TextAlignment.Center; label.Margin = new Thickness(0, 0, 0, 0); var stack = new CustomStackLayout() { Orientation = StackOrientation.Horizontal, HorizontalOptions = LayoutOptions.Start, VerticalOptions = LayoutOptions.Fill, Children = { checkBox, label } }; stack.Margin = new Thickness(0, 0, 0, 10); Assets.Add(stack); } catch (Exception e) { Console.WriteLine("Could not create field" + e); } } } var geomlabel = new Label(); geomlabel.Text = "Zugeordnete Geometrie"; geomlabel.FontAttributes = FontAttributes.Bold; geomlabel.Margin = new Thickness(0, 10, 0, 0); Assets.Add(geomlabel); AssociatedGeometry = new CustomPicker(); Geoms = ReferenceGeometry.GetAllGeometries().Where(g => g.status < 3).OrderBy(g => g.geometryName).ToList(); foreach (var gm in Geoms) { if (gm.geometryName == null) { gm.geometryName = String.Empty; //Avoid a crash on android from null strings } } var general = new ReferenceGeometry() { geometryName = "Allgemeine Beobachtung" }; AssociatedGeometry.ItemsSource = Geoms; AssociatedGeometry.ItemsSource.Insert(0, general); AssociatedGeometry.ItemDisplayBinding = new Binding("geometryName"); AssociatedGeometry.TypeId = -999; if (queriedrec.geometry_fk != null) { var geom = ReferenceGeometry.GetGeometry((int)queriedrec.geometry_fk); var selectedGeomIndex = Geoms.FindIndex(a => a.Id == geom.Id); AssociatedGeometry.SelectedIndex = selectedGeomIndex++; } else { AssociatedGeometry.SelectedIndex = 0; } AssociatedGeometry.Margin = new Thickness(0, 0, 0, 10); AssociatedGeometry.IsEnabled = !ReadOnly; if (ReadOnly) { AssociatedGeometry.SetAppThemeColor(Label.BackgroundColorProperty, Color.FromRgb(0.95, 0.95, 0.95), Color.FromRgb(0.2, 0.2, 0.2)); } AssociatedGeometry.SelectedIndexChanged += DidSelectNewGeometry; Assets.Add(AssociatedGeometry); } var DeleteButton = new Button(); DeleteCommand = new Command(OnDelete, ValidateDelete); DeleteButton.ImageSource = "delete.png"; DeleteButton.Command = DeleteCommand; DeleteButton.Style = (Style)Xamarin.Forms.Application.Current.Resources["DangerButtonStyle"]; DeleteButton.Margin = new Thickness(0, 10); DeleteButton.CornerRadius = 10; DeleteButton.TextTransform = TextTransform.Uppercase; DeleteButton.WidthRequest = 50; var GUIDButton = new Button(); GUIDCommand = new Command(CopyGUID); GUIDButton.Text = "GUID"; GUIDButton.BackgroundColor = (Color)Xamarin.Forms.Application.Current.Resources["BioDivGreen"]; GUIDButton.Command = GUIDCommand; GUIDButton.HorizontalOptions = LayoutOptions.FillAndExpand; GUIDButton.TextColor = Color.White; GUIDButton.Margin = new Thickness(0, 10); GUIDButton.CornerRadius = 10; GUIDButton.TextTransform = TextTransform.Uppercase; GUIDButton.WidthRequest = 250; var buttonLayout = new FlexLayout { Children = { DeleteButton, GUIDButton } }; buttonLayout.Direction = FlexDirection.Row; buttonLayout.JustifyContent = FlexJustify.SpaceAround; buttonLayout.HorizontalOptions = LayoutOptions.FillAndExpand; buttonLayout.AlignContent = FlexAlignContent.SpaceAround; Assets.Add(buttonLayout); SaveCommand = new Command(OnSave, ValidateSave); CancelCommand = new Command(OnCancel); this.PropertyChanged += (_, __) => SaveCommand.ChangeCanExecute(); }
// Add dynamic grids private void CreateDynamicWPFGrid() { // Create the Grid Grid DynamicGrid = new Grid(); DynamicGrid.Width = 700; DynamicGrid.HorizontalAlignment = HorizontalAlignment.Left; DynamicGrid.VerticalAlignment = VerticalAlignment.Top; //DynamicGrid.ShowGridLines = true; //DynamicGrid.Background = new SolidColorBrush(Colors.LightSteelBlue); // Create Columns ColumnDefinition gridCol1 = new ColumnDefinition(); ColumnDefinition gridCol2 = new ColumnDefinition(); ColumnDefinition gridCol3 = new ColumnDefinition(); DynamicGrid.ColumnDefinitions.Add(gridCol1); DynamicGrid.ColumnDefinitions.Add(gridCol2); DynamicGrid.ColumnDefinitions.Add(gridCol3); // Create Rows RowDefinition gridRow1 = new RowDefinition(); gridRow1.Height = new GridLength(20); RowDefinition gridRow2 = new RowDefinition(); gridRow2.Height = new GridLength(25); RowDefinition gridRow3 = new RowDefinition(); gridRow3.Height = new GridLength(25); DynamicGrid.RowDefinitions.Add(gridRow1); DynamicGrid.RowDefinitions.Add(gridRow2); DynamicGrid.RowDefinitions.Add(gridRow3); // Add first column header TextBlock txtBlock1 = new TextBlock(); txtBlock1.Text = "Quick Searches and Folders"; txtBlock1.FontSize = 10; txtBlock1.FontWeight = FontWeights.Normal; txtBlock1.Foreground = new SolidColorBrush(Colors.CadetBlue); txtBlock1.VerticalAlignment = VerticalAlignment.Top; Grid.SetRow(txtBlock1, 0); Grid.SetColumn(txtBlock1, 0); // Add second column header---------- //TextBlock txtBlock2 = new TextBlock(); //txtBlock2.Text = "HEADER 2"; //txtBlock2.FontSize = 14; //txtBlock2.FontWeight = FontWeights.Bold; //txtBlock2.Foreground = new SolidColorBrush(Colors.CadetBlue); //txtBlock2.VerticalAlignment = VerticalAlignment.Top; //Grid.SetRow(txtBlock2, 0); //Grid.SetColumn(txtBlock2, 1); // Add third column header -------------- //TextBlock txtBlock3 = new TextBlock(); //txtBlock3.Text = "Header3"; //txtBlock3.FontSize = 14; //txtBlock3.FontWeight = FontWeights.Bold; //txtBlock3.Foreground = new SolidColorBrush(Colors.CadetBlue); //txtBlock3.VerticalAlignment = VerticalAlignment.Top; //Grid.SetRow(txtBlock3, 0); //Grid.SetColumn(txtBlock3, 2); //// Add column headers to the Grid DynamicGrid.Children.Add(txtBlock1); //DynamicGrid.Children.Add(txtBlock2); //DynamicGrid.Children.Add(txtBlock3); // Create first Row ----- CustomCheckBox CB2 = new CustomCheckBox(); CB2.Content = "Use the same columns for all folders"; CB2.RegLoc = "HKLM"; CB2.ToolTip = CB2.RegLoc; Grid.SetRow(CB2, 1); Grid.SetColumn(CB2, 0); //TextBlock authorText = new TextBlock(); //authorText.Text = "Mahesh Chand"; //authorText.FontSize = 12; //authorText.FontWeight = FontWeights.Bold; //Grid.SetRow(authorText, 1); //Grid.SetColumn(authorText, 0); //TextBlock ageText = new TextBlock(); //ageText.Text = "33"; //ageText.FontSize = 12; //ageText.FontWeight = FontWeights.Bold; //Grid.SetRow(ageText, 1); //Grid.SetColumn(ageText, 1); //TextBlock bookText = new TextBlock(); //bookText.Text = "GDI+ Programming"; //bookText.FontSize = 12; //bookText.FontWeight = FontWeights.Bold; //Grid.SetRow(bookText, 1); //Grid.SetColumn(bookText, 2); // Add first row to Grid DynamicGrid.Children.Add(CB2); //DynamicGrid.Children.Add(ageText); // DynamicGrid.Children.Add(bookText); // Create second row ------ CB2 = new CustomCheckBox(); CB2.Content = "Use the same columns for all folders"; CB2.RegLoc = "HKLM"; CB2.ToolTip = CB2.RegLoc; Grid.SetRow(CB2, 2); Grid.SetColumn(CB2, 0); //authorText = new TextBlock(); //authorText.Text = "Mike Gold"; //authorText.FontSize = 12; //authorText.FontWeight = FontWeights.Bold; //Grid.SetRow(authorText, 2); //Grid.SetColumn(authorText, 0); //ageText = new TextBlock(); //ageText.Text = "35"; //ageText.FontSize = 12; //ageText.FontWeight = FontWeights.Bold; //Grid.SetRow(ageText, 2); //Grid.SetColumn(ageText, 1); //bookText = new TextBlock(); //bookText.Text = "Programming C#"; //bookText.FontSize = 12; //bookText.FontWeight = FontWeights.Bold; //Grid.SetRow(bookText, 2); //Grid.SetColumn(bookText, 2); // Add second row to Grid DynamicGrid.Children.Add(CB2); //DynamicGrid.Children.Add(authorText); //DynamicGrid.Children.Add(ageText); // DynamicGrid.Children.Add(bookText); // Display grid into a Window GenGrid = DynamicGrid; }