MyButtonClick( )
is compatible with the
EventHandler
delegate shown earlier, which
means it can be added to the
Click
event chain. Notice it is private to
ButtonForm
. This is
not technically necessary, but it is a good idea because event handlers are not intended to be
called except in response to events.
Inside the handler, the location of the top of the button is determined from the
Top
property. All controls define the following properties, which specify the coordinates of the
upper-left and lower-right corners:
public int Top { get; set; }
public int Bottom { get; }
public int Left { get; set; }
public int Right { get; }
Notice that the location of the control can be changed by setting
Do'stlaringiz bilan baham: |