Menu
  • HOME
  • TAGS

Find position of mouse relative to control, rather than screen

vb.net,winforms,screen-resolution,windows-controls

Add a mouse click event to your picture box Then use the MouseEventArgs to get the mouse position inside the picture box. This will give you the X and the Y location inside the picture box. Dim PPoint As Point Private Sub PictureBox1_MouseClick(sender As Object, e As MouseEventArgs) Handles PictureBox1.MouseClick...

How to obtain the value of a control added dynamically into Windows Form c#?

c#,winforms,checkbox,combobox,windows-controls

You could use the as operator, like so: foreach (Control ctrl in groupBox.Controls) { CheckBox checkBox = ctrl as CheckBox; ComboBox comboBox = ctrl as ComboBox; if (checkBox != null) // Control is a CheckBox { if (checkBox.Checked) { // CheckBox is checked } else { // CheckBox is not...