Add a public
property to your Form2
class that returns the selected item.
Then, replace the Show()
call with ShowDialog()
(a blocking method) and check the property afterwards.
Also, rename your forms.
More Related Contents:
- How can I read, write, and modify the contents of a notepad (.txt) file, in Winform and WPF? [duplicate]
- Translucent circular Control with text
- How do I pass command-line arguments to a WinForms application?
- Detecting design mode from a Control’s constructor
- How do I get the title of the current active window using c#?
- Close a MessageBox after several seconds
- How to compare two rich text box contents and highlight the characters that are changed?
- How to hide TabPage from TabControl [duplicate]
- How to get the “friendly” OS Version Name?
- Detect WebBrowser complete page loading
- Docking Window inside another Window
- Single-assembly multi-language Windows Forms deployment (ILMerge and satellite assemblies / localization) – possible?
- Application.Exit
- addFontFile from Resources
- C# Adding button with value at runtime [closed]
- C# vertical label in a Windows Forms
- Using DialogResult Correctly
- ComboBox.SelectedText doesn’t give me the SelectedText
- Synchronize Scroll Position of two RichTextBoxes?
- Capturing mouse events from every component
- How to create a Button that can send keys to a conrol without losing focus – Virtual Keyboard
- Getting value of selected item in list box as string
- Closing a form and then call another one
- How to create many labels and textboxes dynamically depending on the value of an integer variable?
- How to compute the correct width of a digit in pixels?
- How to exit all running threads?
- Easiest way to change font and font size
- How do I get all controls of a form in Windows Forms?
- Remove top and bottom padding from Text drawn on an Image
- Validating user input / Give .NET controls status OK or NOK