public void DomainUpDownAccessibleObject_Ctor_Default() { using DomainUpDown domainUpDown = new DomainUpDown(); AccessibleObject accessibleObject = domainUpDown.AccessibilityObject; Assert.NotNull(accessibleObject); Assert.False(domainUpDown.IsHandleCreated); }
//设置棋盘的长度 private void domainUpDown1_SelectedItemChanged(object sender, EventArgs e) { this.buttonPrev.Enabled = false; this.buttonNext.Enabled = false; caFlag = false; DomainUpDown tb = (DomainUpDown)sender; //如果不是空 if (tb.Text != "") { int num = Convert.ToInt32(tb.Text); //num必须是2的幂 if ((num != 0 && (num & (num - 1)) == 0) && num >= Convert.ToInt16(this.textBoxX.Text) && num >= Convert.ToInt16(this.textBoxY.Text)) { //如果size,x,y 都有效 ,tag 为 true ,开始绘图 tb.Tag = true; this.textBoxX.Tag = true; this.textBoxY.Tag = true; tb.BackColor = System.Drawing.SystemColors.Window; vStart(); return; } } tb.Tag = false; vStart(); }
private void toolStripButton4_Click(object sender, EventArgs e) { int formsCount = domainUpDownsList.Count; int x = 100; int y = 35 * (formsCount - 1) + 50; labelBox = new System.Windows.Forms.Label(); labelBox.Location = new System.Drawing.Point(30, y); labelBox.Text = (formsCount + 1).ToString(); labelBox.Size = new System.Drawing.Size(40, 20); domainUpDown = new DomainUpDown { Location = new Point(x, y), Name = "domainUpDown" + formsCount + 1, Size = new Size(500, 100), AllowDrop = true, //AutoSize = true, TabIndex = formsCount + 1, Text = "" }; domainUpDownsList.Add(domainUpDown); if (workTasks != null) { domainUpDown.Items.AddRange(workTasks); } checkBox = new System.Windows.Forms.CheckBox(); checkBox.Location = new System.Drawing.Point(650, y); checkBox.Checked = false; checkBox.Size = new System.Drawing.Size(20, 20); homeTabPage.Controls.Add(labelBox); homeTabPage.Controls.Add(domainUpDown); homeTabPage.Controls.Add(checkBox); }
void ButtonClickOneEvent(object sender, EventArgs e) { currentT = sender as Button; Button button = sender as Button; int xstart = button.Location.X + button.Width + 10; int ystart = button.Location.Y; if (button != null && keepTrack) { if (numInfantry != 0) { Inf = makeBoxes2(xstart, ystart, 0); Inf.BringToFront(); } if (numTanks != 0) { Tanks = makeBoxes2(xstart, ystart + 25, 1); Tanks.BringToFront(); } if (numAir != 0) { Air = makeBoxes2(xstart, ystart + 50, 2);; Air.BringToFront(); } if (numAir != 0 || numInfantry != 0 || numTanks != 0) { confirm = makeConfirmBtn(xstart, ystart + 75); } keepTrack = false; } }
public void DomainItemAccessibleObject_State_Default_ReturnsExpected() { using var domainUpDown = new DomainUpDown(); var accessibleObject = new DomainItemAccessibleObject(null, new DomainItemListAccessibleObject(new DomainUpDownAccessibleObject(domainUpDown))); Assert.Equal(AccessibleStates.Selectable, accessibleObject.State); }
[Test] // bug #80620 public void DomainUpDownClientRectangle_Borders() { DomainUpDown dud = new DomainUpDown(); dud.CreateControl(); Assert.AreEqual(dud.ClientRectangle, new DomainUpDown().ClientRectangle); }
public void DomainUpDownAccessibleObject_Ctor_Default() { using DomainUpDown numericUpDown = new DomainUpDown(); AccessibleObject accessibleObject = numericUpDown.AccessibilityObject; Assert.NotNull(accessibleObject); }
public virtual void ShouldRaiseValueChangedEvent() { DomainUpDown dud = new DomainUpDown(); dud.Items.Add("1"); dud.Items.Add("2"); dud.Items.Add("3"); object oldItem = null, newItem = null; dud.ValueChanged += (sender, e) => { oldItem = e.OldValue; newItem = e.NewValue; }; TestAsync( dud, () => dud.CurrentIndex = 1, () => Assert.AreEqual("1", oldItem), () => Assert.AreEqual("2", newItem), () => dud.CurrentIndex = 2, () => Assert.AreEqual("2", oldItem), () => Assert.AreEqual("3", newItem), () => dud.Value = "1", () => Assert.AreEqual("3", oldItem), () => Assert.AreEqual("1", newItem)); }
public virtual void ShouldThrowExceptionWhenBadIndexIsSet() { DomainUpDown dud = DefaultDomainUpDownToTest; dud.CurrentIndex = 2; dud.CurrentIndex = 1; }
public void DomainUpDown_SelectedIndex_Invalid() { DomainUpDown dud = new DomainUpDown(); dud.Items.Add("item1"); try { dud.SelectedIndex = -2; Assert.Fail("#A1"); } catch (ArgumentOutOfRangeException ex) { Assert.AreEqual(typeof(ArgumentOutOfRangeException), ex.GetType(), "#A2"); Assert.IsNotNull(ex.Message, "#A3"); Assert.IsNotNull(ex.ParamName, "#A4"); Assert.AreEqual("SelectedIndex", ex.ParamName, "#A5"); Assert.IsNull(ex.InnerException, "#A6"); } try { dud.SelectedIndex = 1; Assert.Fail("#B1"); } catch (ArgumentOutOfRangeException ex) { Assert.AreEqual(typeof(ArgumentOutOfRangeException), ex.GetType(), "#A2"); Assert.IsNotNull(ex.Message, "#A3"); Assert.IsNotNull(ex.ParamName, "#A4"); Assert.AreEqual("SelectedIndex", ex.ParamName, "#A5"); Assert.IsNull(ex.InnerException, "#A6"); } }
private void AddInvoice() { DataTable ids = this.voucher.GetIds(); this.txtvoucher.Items.Clear(); if (ids.Rows.Count != 0) { DomainUpDown.DomainUpDownItemCollection items = this.txtvoucher.Items; int nextId = this.voucher.GetNextId(); string str1 = nextId.ToString(); items.Add((object)str1); for (int index = 0; index < ids.Rows.Count; ++index) { this.txtvoucher.Items.Add((object)ids.Rows[index]["voucherno"].ToString()); } this.txtvoucher.SelectedIndex = 0; DomainUpDown domainUpDown = this.txtvoucher; nextId = this.voucher.GetNextId(); string str2 = nextId.ToString(); domainUpDown.Text = str2; } else { this.txtvoucher.Text = this.voucher.GetNextId().ToString(); } }
/// <summary> /// 金種の数分をアイテム追加 /// </summary> /// <param name="domain"></param> /// <param name="numLange"></param> public void AddItems(DomainUpDown domain, int numLange) { for (int i = 0; i <= numLange; i++) { domain.Items.Add(i); } }
public void IValueProviderSetValueTest() { DomainUpDown domainUpDown = new DomainUpDown(); IRawElementProviderSimple provider = ProviderFactory.GetProvider(domainUpDown); IValueProvider valueProvider = (IValueProvider) provider.GetPatternProvider(ValuePatternIdentifiers.Pattern.Id); Assert.IsNotNull(valueProvider, "Not returning ValuePatternIdentifiers."); try { domainUpDown.Enabled = false; valueProvider.SetValue("NEW Item"); Assert.Fail("ElementNotEnabledException not thrown."); } catch (ElementNotEnabledException) { } domainUpDown.Enabled = true; try { domainUpDown.ReadOnly = true; valueProvider.SetValue("NEW Item"); Assert.Fail("ElementNotEnabledException not thrown."); } catch (ElementNotEnabledException) { } domainUpDown.ReadOnly = false; string value = "NEW Item"; valueProvider.SetValue(value); domainUpDown.DownButton(); Assert.AreEqual(value, valueProvider.Value, "SetValue value"); }
public virtual void ShouldRemoveValueIfNoLongerInItems() { DomainUpDown dud = new DomainUpDown(); dud.Items.Add(1); dud.Items.Add(2); dud.Items.Add(3); dud.Value = 3; int oldvalue = -1, newvalue = -1; dud.ValueChanged += (s, e) => { oldvalue = (int)e.OldValue; newvalue = (int)e.NewValue; }; TestAsync( dud, () => Assert.AreEqual(3, dud.Value), () => dud.Items.Remove(3), () => Assert.AreEqual(3, oldvalue), () => Assert.AreEqual(1, newvalue), () => Assert.AreEqual(1, dud.Value)); }
/*+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ * // Initializes content of the DomainUpDown, with choices 1-10. * // @param: DomainUpDown +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+*/ public void InitializeDomainUpDown(DomainUpDown d) { for (int i = 10; i >= 1; i--) { d.Items.Add(i.ToString()); } }
public void SurgeryClearType(Form fSurgery) { Helper helper = new Helper(); // clear surgery type if (FrmSurgery.SurgeryVar.ClearType == 0) { Control updwn = SubRoutine.FindControl(fSurgery, "UpDwnLastNameLetter"); DomainUpDown ctlupdwn = updwn as DomainUpDown; helper.ClearUpDwn(ctlupdwn); Control cbo = SubRoutine.FindControl(fSurgery, "CboFullName"); ComboBox ctlcbo = cbo as ComboBox; helper.ClearComboBox(ctlcbo); } // clear surgery date if (FrmSurgery.SurgeryVar.ClearType == 1) { Control updwn = SubRoutine.FindControl(fSurgery, "UpDwnYear"); DomainUpDown ctlupdwn = updwn as DomainUpDown; helper.ClearUpDwn(ctlupdwn); updwn = SubRoutine.FindControl(fSurgery, "UpDwnMonth"); ctlupdwn = updwn as DomainUpDown; helper.ClearUpDwn(ctlupdwn); } }
public virtual void DomainUpDownPeerOnlySupportsValuePattern() { DomainUpDown item = new DomainUpDown(); DomainUpDownAutomationPeer peer = null; TestAsync( item, () => peer = FrameworkElementAutomationPeer.CreatePeerForElement(item) as DomainUpDownAutomationPeer, () => Assert.IsNull(peer.GetPattern(PatternInterface.Dock), "DomainUpDownAutomationPeer should not support the Dock pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.ExpandCollapse), "DomainUpDownAutomationPeer should not support the ExpandCollapse pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Grid), "DomainUpDownAutomationPeer should not support the Grid pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.GridItem), "DomainUpDownAutomationPeer should not support the GridItem pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Invoke), "DomainUpDownAutomationPeer should not support the Dock pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.MultipleView), "DomainUpDownAutomationPeer should not support the MultipleView pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.RangeValue), "DomainUpDownAutomationPeer should not support the RangeValue pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Scroll), "DomainUpDownAutomationPeer should not support the Scroll pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.ScrollItem), "DomainUpDownAutomationPeer should not support the ScrollItem pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Selection), "DomainUpDownAutomationPeer should not support the Selection pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Table), "DomainUpDownAutomationPeer should not support the Table pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.TableItem), "DomainUpDownAutomationPeer should not support the TableItem pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Toggle), "DomainUpDownAutomationPeer should not support the Toggle pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Transform), "DomainUpDownAutomationPeer should not support the Transform pattern!"), () => Assert.IsNotNull(peer.GetPattern(PatternInterface.Value), "DomainUpDownAutomationPeer should support the Value pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Window), "DomainUpDownAutomationPeer should not support the Window pattern!")); }
public void DomainUpDownAccessibleObject_GetPropertyValue_IsKeyboardFocusable_ReturnsTrue() { using DomainUpDown domainUpDown = new DomainUpDown(); AccessibleObject accessibleObject = domainUpDown.AccessibilityObject; bool isKeyboardFocusable = (bool)accessibleObject.GetPropertyValue(Interop.UiaCore.UIA.IsKeyboardFocusablePropertyId); Assert.True(isKeyboardFocusable); }
public void DomainUpDown_Sorted_SelectedIndexGetSet() { DomainUpDown underTest = GetNewDomainUpDown(true); underTest.SelectedIndex = 3; Assert.Equal(3, underTest.SelectedIndex); Assert.Equal("foo3", underTest.SelectedItem); }
protected override Control GetControl() { DomainUpDown domainUpDown = new DomainUpDown(); domainUpDown.Name = "I'm a happy SWF domainUpDown :)"; return(domainUpDown); }
public void DomainItemAccessibleObject_Name_Set_ReturnsExpected(string testValue) { using var domainUpDown = new DomainUpDown(); var accessibleObject = new DomainItemAccessibleObject(null, new DomainItemListAccessibleObject(new DomainUpDownAccessibleObject(domainUpDown))); accessibleObject.Name = testValue; Assert.Equal(testValue, accessibleObject.Name); }
private void MySub() { // Create and initialize the DomainUpDown control. domainUpDown1 = new System.Windows.Forms.DomainUpDown(); // Add the DomainUpDown control to the form. Controls.Add(domainUpDown1); }
public void DomainUpDown_MatchIndex(string search, int start, int index) { DomainUpDown underTest = GetNewDomainUpDown(); var expected = index; var actual = underTest.MatchIndex(search, false, start); Assert.Equal(expected, actual); }
public void DomainUpDown_SelectedIndexGetSet(int indexToSet, int indexAfterSet, string value) { DomainUpDown underTest = GetNewDomainUpDown(); underTest.SelectedIndex = indexToSet; Assert.Equal(indexAfterSet, underTest.SelectedIndex); Assert.Equal(value, underTest.SelectedItem); }
private void InitializeMyDomainUpDown() { // Create and initialize the DomainUpDown control. domainUpDown1 = new DomainUpDown(); // Add the DomainUpDown control to the form. Controls.Add(domainUpDown1); }
public void DomainItemAccessibleObject_Value_Default_ReturnsExpected() { string testName = "Some test name"; using var domainUpDown = new DomainUpDown(); var accessibleObject = new DomainItemAccessibleObject(testName, new DomainItemListAccessibleObject(new DomainUpDownAccessibleObject(domainUpDown))); Assert.Equal(testName, accessibleObject.Value); }
public virtual void ShouldThrowExceptionOnItemsManipulationWhenItemsSourceIsSet() { DomainUpDown dud = DefaultDomainUpDownToTest; IEnumerable domains = new object[] { "1", "2", "3", "4" }; dud.ItemsSource = domains; dud.Items.Add("item should not be able to be added when itemssource is set"); }
public virtual void ShouldHandleSettingItemsSourceToZeroCountCollection() { DomainUpDown dud = new DomainUpDown(); dud.ItemsSource = new object[0]; Assert.AreEqual(-1, dud.CurrentIndex); Assert.IsNull(dud.Value); }
public virtual void ShouldSelectAValueWhenAddingItems() { DomainUpDown dud = new DomainUpDown(); dud.Items.Add("1"); dud.Items.Add("2"); Assert.AreEqual("1", dud.Value); }
public TUpdownZoomDecending(DomainUpDown ud, ZoomTrackBarControl tbar) : base(ud, tbar) { //UpDown = ud; //UpDown.SelectedItemChanged += UpDown_SelectedItemChanged; //UpDown.Leave += UpDown_Leave; //TrackBar = tbar; //TrackBar.ValueChanged += TrackBar_ValueChanged; }
public virtual void DomainUpDownCreatesCorrectAutomationPeer() { DomainUpDown dud = new DomainUpDown(); DomainUpDownAutomationPeer peer = null; TestAsync( dud, () => peer = FrameworkElementAutomationPeer.CreatePeerForElement(dud) as DomainUpDownAutomationPeer, () => Assert.IsNotNull(peer, "DomainUpDown peer should not be null!"), () => Assert.AreEqual(dud, peer.Owner, "DomainUpDown should be owner of the peer!")); }
public UpDownExam() { numeric = new NumericUpDown(); numeric.Parent = this; numeric.SetBounds(20, 20, 100, 30); numeric.Minimum = -1000; numeric.Maximum = 9000; numeric.Value = 1000; numeric.Increment = 1000; numeric.ThousandsSeparator = true; numeric.ValueChanged += new EventHandler(numeric_ValueChanged); domain = new DomainUpDown(); domain.Parent = this; domain.SetBounds(20, 50, 100, 30); for (int i = 0; i < str.Length; i++) { domain.Items.Add(str[i]); } domain.Text = "색상 선택"; domain.SelectedItemChanged += new EventHandler(domain_SelectedItemChanged); }
public virtual void DomainUpDownPeerOnlySupportsValuePattern() { DomainUpDown item = new DomainUpDown(); DomainUpDownAutomationPeer peer = null; TestAsync( item, () => peer = FrameworkElementAutomationPeer.CreatePeerForElement(item) as DomainUpDownAutomationPeer, () => Assert.IsNull(peer.GetPattern(PatternInterface.Dock), "DomainUpDownAutomationPeer should not support the Dock pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.ExpandCollapse), "DomainUpDownAutomationPeer should not support the ExpandCollapse pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Grid), "DomainUpDownAutomationPeer should not support the Grid pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.GridItem), "DomainUpDownAutomationPeer should not support the GridItem pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Invoke), "DomainUpDownAutomationPeer should not support the Dock pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.MultipleView), "DomainUpDownAutomationPeer should not support the MultipleView pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.RangeValue), "DomainUpDownAutomationPeer should not support the RangeValue pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Scroll), "DomainUpDownAutomationPeer should not support the Scroll pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.ScrollItem), "DomainUpDownAutomationPeer should not support the ScrollItem pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Selection), "DomainUpDownAutomationPeer should not support the Selection pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Table), "DomainUpDownAutomationPeer should not support the Table pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.TableItem), "DomainUpDownAutomationPeer should not support the TableItem pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Toggle), "DomainUpDownAutomationPeer should not support the Toggle pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Transform), "DomainUpDownAutomationPeer should not support the Transform pattern!"), () => Assert.IsNotNull(peer.GetPattern(PatternInterface.Value), "DomainUpDownAutomationPeer should support the Value pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Window), "DomainUpDownAutomationPeer should not support the Window pattern!")); }
public MainDialog() { Text="Dialog based application"; StartPosition = FormStartPosition.Manual; Location = new Point(100, 100); Size = new Size(700, 400); Closed += new EventHandler(MainDialog_Closed); m_Label = new Label(); m_Label.Text = ".Net Framevork"; m_Label.Name = "Label1"; m_Label.Location = new Point(16, 16); m_Label.Size = new Size(120, 16); m_Label.TextAlign = ContentAlignment.MiddleCenter; m_Label.Font = new Font("Arial", 10F, FontStyle.Italic | FontStyle.Bold); m_Label.ForeColor = Color.FromArgb(255, 0, 0); Controls.Add(m_Label); m_LLabel = new LinkLabel(); m_LLabel.Name = "Label2"; //m_LLabel.Text = "www.microsoft.com"; m_LLabel.Text = "text.txt"; m_LLabel.Location = new Point(16, 40); m_LLabel.Size = new Size(120, 16); m_LLabel.TextAlign = ContentAlignment.MiddleCenter; m_LLabel.LinkClicked += new LinkLabelLinkClickedEventHandler(L2_LClicked); Controls.Add(m_LLabel); m_B = new Button(); m_B.Text = "Push me"; m_B.Location = new Point(18, 70); m_B.Size = new Size(100, 24); m_B.FlatStyle = System.Windows.Forms.FlatStyle.Popup; m_B.Click += new System.EventHandler(B_C); Controls.Add(m_B); m_TB = new TextBox(); m_TB.Text = ""; m_TB.Location = new Point(140, 16); m_TB.Size = new Size(160, 190); m_TB.Multiline = true; m_TB.MaxLength = 1000; m_TB.ScrollBars = ScrollBars.Both; m_TB.WordWrap = false; m_TB.TextChanged += new EventHandler(TB_TextChanged); Controls.Add(m_TB); m_RB_Red = new RadioButton(); m_RB_Red.Text = "Red"; m_RB_Red.Checked = false; m_RB_Red.Location = new Point(16, 16); m_RB_Red.Size = new Size(80, 20); m_RB_Red.Click += new System.EventHandler(RB_Click); m_RB_Red.Click += new System.EventHandler(RB_Click_Mes); m_RB_Green = new RadioButton(); m_RB_Green.Text = "Green"; m_RB_Green.Checked = true; m_RB_Green.Location = new Point(16, 36); m_RB_Green.Size = new Size(80, 20); m_RB_Green.Click += new System.EventHandler(RB_Click); m_RB_Blue = new RadioButton(); m_RB_Blue.Text = "Blue"; m_RB_Blue.Checked = false; m_RB_Blue.Location = new Point(16, 56); m_RB_Blue.Size = new Size(80, 20); m_RB_Blue.Click += new System.EventHandler(RB_Click); m_B.BackColor = Color.Green; m_GB_Color = new GroupBox(); m_GB_Color.Text = "Choose color"; m_GB_Color.Location = new Point(18, 100); m_GB_Color.Size = new Size(100, 80); m_GB_Color.Controls.AddRange(new Control[] {m_RB_Red, m_RB_Green, m_RB_Blue}); Controls.Add(m_GB_Color); m_TT = new ToolTip(); m_TT.AutomaticDelay = 300; m_TT.ShowAlways = true; m_TT.SetToolTip(m_B, "pressing the button will display message box"); m_LB = new ListBox(); m_LB.Items.Clear(); m_LB.IntegralHeight = false; m_LB.Location = new Point(310, 16); m_LB.Size = new Size(160, 90); m_LB.Items.AddRange(new object[]{"Red", "Orange", "Yellow", "Green", "Blue", "Indigo", "Violet"}); m_LB.SelectionMode = SelectionMode.MultiSimple; m_LB.SetSelected(1, true); m_LB.SelectedIndexChanged += new EventHandler(LB_SelIndChanged); Controls.Add(m_LB); m_CLB = new CheckedListBox(); m_CLB.Items.Clear(); m_CLB.IntegralHeight = false; m_CLB.Location = new Point(310, 110); m_CLB.Size = new Size(160, 90); m_CLB.Items.AddRange(new object[]{"Red", "Orange", "Yellow", "Green", "Blue", "Indigo", "Violet"}); m_CLB.SelectionMode = SelectionMode.One; m_CLB.SetSelected(1, true); m_CLB.CheckOnClick = true; m_CLB.SelectedIndexChanged += new EventHandler(CLB_SelIndChanged); Controls.Add(m_CLB); m_CB = new ComboBox(); m_CB.Items.Clear(); m_CB.Location = new Point(480, 16); m_CB.Size = new Size(160, 20); m_CB.DropDownStyle = ComboBoxStyle.DropDownList; m_CB.Items.AddRange(new object[]{"Red", "Orange", "Yellow", "Green", "Blue", "Indigo", "Violet"}); m_CB.SelectedIndex = 0; m_CB.SelectedIndexChanged += new EventHandler(CB_TextChanged); Controls.Add(m_CB); m_DUD = new DomainUpDown(); m_DUD.Items.Clear(); m_DUD.Location = new Point(480, 46); m_DUD.Size = new Size(160, 20); m_DUD.Items.AddRange(new object[]{"Red", "Orange", "Yellow", "Green", "Blue", "Indigo", "Violet"}); m_DUD.ReadOnly = true; m_DUD.UpDownAlign = LeftRightAlignment.Left; m_DUD.TextAlign = HorizontalAlignment.Right; m_DUD.Wrap = true; m_DUD.SelectedIndex = 1; Controls.Add(m_DUD); m_NUD = new NumericUpDown(); m_NUD.Location = new Point(480, 76); m_NUD.Size = new Size(160, 20); m_NUD.Minimum = new Decimal(-10); m_NUD.Maximum = new Decimal(10); m_NUD.Increment = new Decimal(0.1); m_NUD.DecimalPlaces = 1; m_NUD.Value = new Decimal(0.0); m_NUD.ValueChanged += new EventHandler(NUD_ValueChanged); Controls.Add(m_NUD); m_CT_L = new Label(); m_CT_L.Text = ""; m_CT_L.Location = new Point(18, 220); m_CT_L.Size = new Size(100, 16); m_CT_L.BorderStyle = BorderStyle.Fixed3D; m_CT_L.TextAlign = ContentAlignment.MiddleCenter; Controls.Add(m_CT_L); m_STT_B = new Button(); m_STT_B.Text = "Start timer"; m_STT_B.Location = new Point(18, 246); m_STT_B.Size = new Size(100, 24); m_STT_B.Click += new EventHandler(STT_BC); Controls.Add(m_STT_B); m_SPT_B = new Button(); m_SPT_B.Text = "Stop timer"; m_SPT_B.Location = new Point(18, 280); m_SPT_B.Size = new Size(100, 24); m_SPT_B.Click += new EventHandler(STP_BC); Controls.Add(m_SPT_B); m_T = new Timer(); m_T.Enabled = true; m_T.Interval = 100; m_T.Stop(); m_T.Tick += new EventHandler(T_T); m_LL = new Label(); m_LL.Location = new Point(480, 116); m_LL.Size = new Size(160, 20); m_LL.TextAlign = ContentAlignment.MiddleCenter; Controls.Add(m_LL); m_TrB = new TrackBar(); m_TrB.Minimum = 0; m_TrB.Maximum = 100; m_TrB.Value = 50; m_LL.Text = "Nivelul indicatorul este " + m_TrB.Value; m_TrB.Location = new Point(480, 146); m_TrB.Size = new Size(160, 20); m_TrB.Orientation = Orientation.Horizontal; m_TrB.TickStyle = TickStyle.TopLeft; m_TrB.TickFrequency = 10; m_TrB.Scroll += new EventHandler(TrB_Scroll); Controls.Add(m_TrB); }
public virtual void CreateDomainUpDownPeer() { DomainUpDown dud = new DomainUpDown(); new DomainUpDownAutomationPeer(dud); }
public virtual void DomainUpDownPeerIsIValueProvider() { DomainUpDown dud = new DomainUpDown(); IValueProvider provider = null; TestAsync( dud, () => provider = FrameworkElementAutomationPeer.CreatePeerForElement(dud) as IValueProvider, () => Assert.IsNotNull(provider, "DomainUpDownAutomationPeer should implement IValueProvider!")); }