Browse Components

  • Thread starter Thread starter Jorge
  • Start date Start date
J

Jorge

Hello
I finally found out why context menus don't show in
form.controls its a component!

I did a google search and someone sugested to use the
site property.

The followoing code :

Public Sub teste(ByVal f As Form)
Dim a As New System.ComponentModel.Component
MessageBox.Show
(f.Site.Container.Components.Count.ToString)
For Each a In f.Site.Container.Components
MessageBox.Show(a.GetType.ToString)
Next
End Sub

Produces the following exception:
An unhandled exception of
type 'System.NullReferenceException' occurred in SIGDIN
2003.exe

Additional information: Object reference not set to an
instance of an object.

The problem is that site = nothing...

What am i doing wrong? Any suggestion would be most
welcome, thanks

Kind Regards
Jorge
 
Ok got it to work i used :

System.Reflection.FieldInfo()

Kind Regards
Jorge Cavalheiro
 
Back
Top