1 write to _toolStripTextBox
System.Windows.Forms.Tests (1)
System\Windows\Forms\ToolStripTextBoxTests.cs (1)
14
_toolStripTextBox
= new();
245 references to _toolStripTextBox
System.Windows.Forms.Tests (245)
System\Windows\Forms\ToolStripTextBoxTests.cs (245)
19
_toolStripTextBox
.Dispose();
27
_toolStripTextBox
.Name = name;
28
_toolStripTextBox
.Name.Should().Be(name);
56
_toolStripTextBox
.BackgroundImage = image;
57
_toolStripTextBox
.BackgroundImage.Should().Be(image);
59
_toolStripTextBox
.BackgroundImage = null;
60
_toolStripTextBox
.BackgroundImage.Should().BeNull();
69
_toolStripTextBox
.BackgroundImageLayout = imageLayout;
70
_toolStripTextBox
.BackgroundImageLayout.Should().Be(imageLayout);
77
_toolStripTextBox
.AcceptsTabChanged += (sender, e) => eventRaised = true;
79
_toolStripTextBox
.AcceptsTab = true;
80
_toolStripTextBox
.AcceptsTab.Should().BeTrue();
85
_toolStripTextBox
.AcceptsTab = true;
86
_toolStripTextBox
.AcceptsTab.Should().BeTrue();
89
_toolStripTextBox
.AcceptsTab = false;
90
_toolStripTextBox
.AcceptsTab.Should().BeFalse();
99
_toolStripTextBox
.HideSelectionChanged += (sender, args) => eventRaised = true;
100
_toolStripTextBox
.HideSelection = !
_toolStripTextBox
.HideSelection;
109
_toolStripTextBox
.Modified = modified;
110
_toolStripTextBox
.Modified.Should().Be(modified);
117
_toolStripTextBox
.Multiline = multiline;
118
_toolStripTextBox
.Multiline.Should().Be(multiline);
125
_toolStripTextBox
.TextBoxTextAlignChanged += (sender, e) => eventRaised = true;
126
_toolStripTextBox
.TestAccessor().Dynamic.HandleTextBoxTextAlignChanged(null, EventArgs.Empty);
135
_toolStripTextBox
.AcceptsTabChanged += (sender, e) => eventRaised = true;
136
_toolStripTextBox
.TestAccessor().Dynamic.OnAcceptsTabChanged(EventArgs.Empty);
145
_toolStripTextBox
.BorderStyleChanged += (sender, e) => eventRaised = true;
146
_toolStripTextBox
.TestAccessor().Dynamic.OnBorderStyleChanged(EventArgs.Empty);
155
_toolStripTextBox
.HideSelectionChanged += (sender, e) => eventRaised = true;
156
_toolStripTextBox
.TestAccessor().Dynamic.OnHideSelectionChanged(EventArgs.Empty);
165
_toolStripTextBox
.ModifiedChanged += (sender, e) => eventRaised = true;
166
_toolStripTextBox
.TestAccessor().Dynamic.OnModifiedChanged(EventArgs.Empty);
175
_toolStripTextBox
.MultilineChanged += (sender, e) => eventRaised = true;
176
_toolStripTextBox
.TestAccessor().Dynamic.OnMultilineChanged(EventArgs.Empty);
184
_toolStripTextBox
.Font = ToolStripManager.DefaultFont;
185
bool result =
_toolStripTextBox
.TestAccessor().Dynamic.ShouldSerializeFont();
188
_toolStripTextBox
.Font = new Font("Arial", 8.25f);
189
result =
_toolStripTextBox
.TestAccessor().Dynamic.ShouldSerializeFont();
197
_toolStripTextBox
.AcceptsReturn = acceptsReturn;
198
_toolStripTextBox
.AcceptsReturn.Should().Be(acceptsReturn);
205
_toolStripTextBox
.AutoCompleteCustomSource = collection;
206
_toolStripTextBox
.AutoCompleteCustomSource.Should().BeEquivalentTo(collection);
209
_toolStripTextBox
.AutoCompleteCustomSource = newCollection;
210
_toolStripTextBox
.AutoCompleteCustomSource.Should().BeEquivalentTo(newCollection);
218
_toolStripTextBox
.AutoCompleteSource = autoCompleteSource;
219
_toolStripTextBox
.AutoCompleteSource.Should().Be(autoCompleteSource);
227
_toolStripTextBox
.BorderStyle = borderStyle;
228
_toolStripTextBox
.BorderStyle.Should().Be(borderStyle);
236
_toolStripTextBox
.CharacterCasing = characterCasing;
237
_toolStripTextBox
.CharacterCasing.Should().Be(characterCasing);
247
_toolStripTextBox
.Multiline = multiline;
248
_toolStripTextBox
.Lines = inputLines;
249
_toolStripTextBox
.Lines.Should().Equal(inputLines ?? Array.Empty<string>());
257
_toolStripTextBox
.MaxLength = maxLength;
258
_toolStripTextBox
.MaxLength.Should().Be(maxLength);
265
_toolStripTextBox
.ReadOnly = readOnly;
266
_toolStripTextBox
.ReadOnly.Should().Be(readOnly);
275
_toolStripTextBox
.Text = initialText;
276
_toolStripTextBox
.SelectionStart = selectionStart;
277
_toolStripTextBox
.SelectionLength = selectionLength;
278
_toolStripTextBox
.SelectedText.Should().Be(expectedSelectedText);
290
_toolStripTextBox
.Text = new string('a', textLength.Value);
291
_toolStripTextBox
.SelectionLength = textLength.Value;
292
_toolStripTextBox
.SelectionLength.Should().Be(textLength.Value);
296
_toolStripTextBox
.Invoking(t => t.Text = null).Should().NotThrow();
297
_toolStripTextBox
.Text.Should().BeNullOrEmpty();
307
_toolStripTextBox
.Text = "0123456789";
308
_toolStripTextBox
.SelectionStart = value;
309
_toolStripTextBox
.SelectionStart.Should().Be(value);
316
_toolStripTextBox
.ShortcutsEnabled = shortcutsEnabled;
317
_toolStripTextBox
.ShortcutsEnabled.Should().Be(shortcutsEnabled);
327
_toolStripTextBox
.Text = text;
328
_toolStripTextBox
.TextLength.Should().Be(expectedLength);
337
_toolStripTextBox
.TextBoxTextAlign = textAlign;
338
_toolStripTextBox
.TextBoxTextAlign.Should().Be(textAlign);
345
_toolStripTextBox
.WordWrap = wordWrap;
346
_toolStripTextBox
.WordWrap.Should().Be(wordWrap);
355
sender.Should().Be(
_toolStripTextBox
);
360
_toolStripTextBox
.AcceptsTabChanged += handler;
361
_toolStripTextBox
.AcceptsTab = !
_toolStripTextBox
.AcceptsTab;
364
_toolStripTextBox
.AcceptsTabChanged -= handler;
365
_toolStripTextBox
.AcceptsTab = !
_toolStripTextBox
.AcceptsTab;
376
_toolStripTextBox
.AcceptsTabChanged += handler1;
377
_toolStripTextBox
.AcceptsTabChanged += handler2;
378
_toolStripTextBox
.AcceptsTab = !
_toolStripTextBox
.AcceptsTab;
382
_toolStripTextBox
.AcceptsTabChanged -= handler1;
383
_toolStripTextBox
.AcceptsTab = !
_toolStripTextBox
.AcceptsTab;
387
_toolStripTextBox
.AcceptsTabChanged -= handler2;
388
_toolStripTextBox
.AcceptsTab = !
_toolStripTextBox
.AcceptsTab;
399
sender.Should().BeSameAs(
_toolStripTextBox
);
404
_toolStripTextBox
.BorderStyleChanged += handler;
405
_toolStripTextBox
.BorderStyle = BorderStyle.None;
407
_toolStripTextBox
.BorderStyle.Should().Be(BorderStyle.None);
409
_toolStripTextBox
.BorderStyleChanged -= handler;
410
_toolStripTextBox
.BorderStyle = BorderStyle.Fixed3D;
412
_toolStripTextBox
.BorderStyle.Should().Be(BorderStyle.Fixed3D);
422
_toolStripTextBox
.BorderStyleChanged += handler1;
423
_toolStripTextBox
.BorderStyleChanged += handler2;
424
_toolStripTextBox
.BorderStyle = BorderStyle.None;
427
_toolStripTextBox
.BorderStyle.Should().Be(BorderStyle.None);
429
_toolStripTextBox
.BorderStyleChanged -= handler1;
430
_toolStripTextBox
.BorderStyle = BorderStyle.Fixed3D;
433
_toolStripTextBox
.BorderStyle.Should().Be(BorderStyle.Fixed3D);
435
_toolStripTextBox
.BorderStyleChanged -= handler2;
436
_toolStripTextBox
.BorderStyle = BorderStyle.None;
439
_toolStripTextBox
.BorderStyle.Should().Be(BorderStyle.None);
448
sender.Should().Be(
_toolStripTextBox
);
453
_toolStripTextBox
.HideSelectionChanged += handler;
454
_toolStripTextBox
.HideSelection = false;
456
_toolStripTextBox
.HideSelection.Should().BeFalse();
458
_toolStripTextBox
.HideSelectionChanged -= handler;
459
_toolStripTextBox
.HideSelection = true;
461
_toolStripTextBox
.HideSelection.Should().BeTrue();
471
_toolStripTextBox
.HideSelectionChanged += handler1;
472
_toolStripTextBox
.HideSelectionChanged += handler2;
473
_toolStripTextBox
.HideSelection = false;
476
_toolStripTextBox
.HideSelection.Should().BeFalse();
478
_toolStripTextBox
.HideSelectionChanged -= handler1;
479
_toolStripTextBox
.HideSelection = true;
482
_toolStripTextBox
.HideSelection.Should().BeTrue();
484
_toolStripTextBox
.HideSelectionChanged -= handler2;
485
_toolStripTextBox
.HideSelection = false;
488
_toolStripTextBox
.HideSelection.Should().BeFalse();
497
sender.Should().Be(
_toolStripTextBox
);
502
_toolStripTextBox
.ModifiedChanged += handler;
503
_toolStripTextBox
.Modified = true;
505
_toolStripTextBox
.Modified.Should().BeTrue();
507
_toolStripTextBox
.ModifiedChanged -= handler;
508
_toolStripTextBox
.Modified = false;
510
_toolStripTextBox
.Modified.Should().BeFalse();
520
_toolStripTextBox
.ModifiedChanged += handler1;
521
_toolStripTextBox
.ModifiedChanged += handler2;
522
_toolStripTextBox
.Modified = true;
525
_toolStripTextBox
.Modified.Should().BeTrue();
527
_toolStripTextBox
.ModifiedChanged -= handler1;
528
_toolStripTextBox
.Modified = false;
531
_toolStripTextBox
.Modified.Should().BeFalse();
533
_toolStripTextBox
.ModifiedChanged -= handler2;
534
_toolStripTextBox
.Modified = true;
537
_toolStripTextBox
.Modified.Should().BeTrue();
546
sender.Should().Be(
_toolStripTextBox
);
551
_toolStripTextBox
.MultilineChanged += handler;
552
_toolStripTextBox
.Multiline = true;
554
_toolStripTextBox
.Multiline.Should().BeTrue();
556
_toolStripTextBox
.MultilineChanged -= handler;
557
_toolStripTextBox
.Multiline = false;
559
_toolStripTextBox
.Multiline.Should().BeFalse();
569
_toolStripTextBox
.MultilineChanged += handler1;
570
_toolStripTextBox
.MultilineChanged += handler2;
571
_toolStripTextBox
.Multiline = true;
574
_toolStripTextBox
.Multiline.Should().BeTrue();
576
_toolStripTextBox
.MultilineChanged -= handler1;
577
_toolStripTextBox
.Multiline = false;
580
_toolStripTextBox
.Multiline.Should().BeFalse();
582
_toolStripTextBox
.MultilineChanged -= handler2;
583
_toolStripTextBox
.Multiline = true;
586
_toolStripTextBox
.Multiline.Should().BeTrue();
595
sender.Should().Be(
_toolStripTextBox
);
600
_toolStripTextBox
.ReadOnlyChanged += handler;
601
_toolStripTextBox
.ReadOnly = true;
603
_toolStripTextBox
.ReadOnly.Should().BeTrue();
605
_toolStripTextBox
.ReadOnlyChanged -= handler;
606
_toolStripTextBox
.ReadOnly = false;
608
_toolStripTextBox
.ReadOnly.Should().BeFalse();
618
_toolStripTextBox
.ReadOnlyChanged += handler1;
619
_toolStripTextBox
.ReadOnlyChanged += handler2;
620
_toolStripTextBox
.ReadOnly = true;
623
_toolStripTextBox
.ReadOnly.Should().BeTrue();
625
_toolStripTextBox
.ReadOnlyChanged -= handler1;
626
_toolStripTextBox
.ReadOnly = false;
629
_toolStripTextBox
.ReadOnly.Should().BeFalse();
631
_toolStripTextBox
.ReadOnlyChanged -= handler2;
632
_toolStripTextBox
.ReadOnly = true;
635
_toolStripTextBox
.ReadOnly.Should().BeTrue();
644
sender.Should().Be(
_toolStripTextBox
);
649
_toolStripTextBox
.TextBoxTextAlignChanged += handler;
650
_toolStripTextBox
.TextBoxTextAlign = HorizontalAlignment.Center;
652
_toolStripTextBox
.TextBoxTextAlign.Should().Be(HorizontalAlignment.Center);
654
_toolStripTextBox
.TextBoxTextAlignChanged -= handler;
655
_toolStripTextBox
.TextBoxTextAlign = HorizontalAlignment.Left;
657
_toolStripTextBox
.TextBoxTextAlign.Should().Be(HorizontalAlignment.Left);
667
_toolStripTextBox
.TextBoxTextAlignChanged += handler1;
668
_toolStripTextBox
.TextBoxTextAlignChanged += handler2;
669
_toolStripTextBox
.TextBoxTextAlign = HorizontalAlignment.Center;
672
_toolStripTextBox
.TextBoxTextAlign.Should().Be(HorizontalAlignment.Center);
674
_toolStripTextBox
.TextBoxTextAlignChanged -= handler1;
675
_toolStripTextBox
.TextBoxTextAlign = HorizontalAlignment.Left;
678
_toolStripTextBox
.TextBoxTextAlign.Should().Be(HorizontalAlignment.Left);
680
_toolStripTextBox
.TextBoxTextAlignChanged -= handler2;
681
_toolStripTextBox
.TextBoxTextAlign = HorizontalAlignment.Center;
684
_toolStripTextBox
.TextBoxTextAlign.Should().Be(HorizontalAlignment.Center);
690
_toolStripTextBox
.AppendText("Hello");
691
_toolStripTextBox
.Text.Should().Be("Hello");
697
_toolStripTextBox
.Text = "Hello";
698
_toolStripTextBox
.Clear();
699
_toolStripTextBox
.Text.Should().BeEmpty();
705
_toolStripTextBox
.Text = "Hello";
706
_toolStripTextBox
.ClearUndo();
707
_toolStripTextBox
.Undo();
708
_toolStripTextBox
.Text.Should().Be("Hello");
714
_toolStripTextBox
.Text = "Hello";
715
_toolStripTextBox
.SelectAll();
716
_toolStripTextBox
.DeselectAll();
717
_toolStripTextBox
.SelectionLength.Should().Be(0);
728
_toolStripTextBox
.Text = text;
729
char result =
_toolStripTextBox
.GetCharFromPosition(new Point(x, y));
736
_toolStripTextBox
.Text = "Hello";
737
int result =
_toolStripTextBox
.GetCharIndexFromPosition(new Point(1, 1));
744
_toolStripTextBox
.Multiline = true;
745
_toolStripTextBox
.Text = "Hello\r\nWorld\r\nTest";
747
_toolStripTextBox
.GetFirstCharIndexFromLine(0).Should().Be(0);
748
_toolStripTextBox
.GetFirstCharIndexFromLine(1).Should().Be(7);
749
_toolStripTextBox
.GetFirstCharIndexFromLine(2).Should().Be(14);
755
_toolStripTextBox
.Multiline = true;
756
_toolStripTextBox
.Text = "Hello\r\nWorld\r\nTest";
757
_toolStripTextBox
.SelectionStart = 7;
759
_toolStripTextBox
.GetFirstCharIndexOfCurrentLine().Should().Be(7);
765
_toolStripTextBox
.Multiline = true;
766
_toolStripTextBox
.Text = "Hello\r\nWorld\r\nTest";
768
_toolStripTextBox
.GetLineFromCharIndex(0).Should().Be(0);
769
_toolStripTextBox
.GetLineFromCharIndex(7).Should().Be(1);
770
_toolStripTextBox
.GetLineFromCharIndex(14).Should().Be(2);
776
_toolStripTextBox
.Text = "Hello World";
778
_toolStripTextBox
.GetPositionFromCharIndex(0).Should().Be(new Point(1, 0));
779
_toolStripTextBox
.GetPositionFromCharIndex(5).Should().Be(new Point(29, 0));
780
_toolStripTextBox
.GetPositionFromCharIndex(10).Should().Be(new Point(57, 0));
786
_toolStripTextBox
.Text = "Hello\nWorld";
787
_toolStripTextBox
.SelectionStart =
_toolStripTextBox
.Text.Length;
788
_toolStripTextBox
.ScrollToCaret();
789
Point position =
_toolStripTextBox
.GetPositionFromCharIndex(
_toolStripTextBox
.SelectionStart);
790
position.Y.Should().BeLessOrEqualTo(
_toolStripTextBox
.Height);
796
_toolStripTextBox
.Text = "Hello World";
797
_toolStripTextBox
.Select(6, 5);
798
_toolStripTextBox
.SelectedText.Should().Be("World");
804
_toolStripTextBox
.Text = "Hello World";
805
_toolStripTextBox
.SelectAll();
806
_toolStripTextBox
.SelectedText.Should().Be("Hello World");