July 2003
Intermediate to advanced
736 pages
16h 35m
English
Visual Basic .NET still supports late binding. Late binding is what happens when the type of an object is general and the instance of an object is specific. For example, if you declare a variable as an Object type and initialize a Button control, assigning the Button instance to the Object variable, you are using late binding. Late binding is supported through Reflection. Listing 4.1 offers an example.
Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click Dim C As Object C = New Button() C.Text = "Test" C.Bounds = CType(sender, Control).Bounds C.Location = New Point(C.Location.X, C.Location.Y + C.Size.Height ... |
Read now
Unlock full access