Why is there a difference in intellisense / type for certain GUI controls when filtering events

I noticed that depending on the type of control, VS sometimes correctly determines the type to which it belongs, but sometimes it just adheres to a few general ones EventArgs.

Is this some Winforms / .Net artifact?

For example, in this case, I have several tabs in the form (f1). X will be correctly identified as TabControlEventArgs, and I can insert it into it.

f1.tabControl1.Selected
    |> Event.filter (fun x -> x.TabPage.Name <> "Tab3")
    |> Event.add (fun _ -> f1.comboBox2.Enabled <- false) 

enter image description here

But in the following case, x will simply show EventArgs, and I must explicitly identify the property:

f1.my2CheckBox.CheckedChanged
    |> Event.filter (fun x ->  not f1.my2CheckBox.Checked)
    |> Event.add (fun x -> f1.comboBox2.Enabled <- false)

enter image description here

, , , . , , , , , tabcontrol .

+4
1

winforms/.Net ?

, Windows Forms, ... , . , TabControl.Selected TabControlEventHandler :

public delegate void TabControlEventHandler(object sender, TabControlEventArgs e)

... while CheckBox.Changed EventHandler, :

public delegate void EventHandler(object sender, EventArgs e)

, ​​ . , , , , . CheckBoxChanged, , .

+7

All Articles