Function address (do not know if it is exact!)

zhaozj2021-02-16  48

This question is written in a TAPPLICATION for the netizen!

The content of the discussion is just a function address!

If you want to display time on TSTATUSBAR now, you may have a lot of ways, now you look at this:

Void __fastcall tform1 :: tryidle (TOBJECT * Sender, Bool & Done) {form1-> statusbar1-> simpletext = datetimetostr (now ());}

Void __fastcall tform1 :: button2click (TOBJECT * Sender) {form1-> OndblClick = Tryer; Application-> Onder = Tryidle; Form1-> Button1-> onclick = button3click;

If you must ask me: Sender and done do what to do, I tell you that there is no use at all, just in order to make an exact samething like Application-> OnIdle!

The items on the top are taken from an article in www.chinabcb.com! First, I think about what I think, I don't know if it is meaningful. If you have help, then don't forget to thank the scene behind the scenes!

Can other objects? I think it is okay, so I will continue, I will write a few TButton on Form1!

Void __fastcall tform1 :: button3click (TOBJECT * Sender) {ShowMessage ("Button3Click!");

Void __fastcall tform1 :: button2click (TOBJECT * Sender) {form1-> onDblclick = tryder; application-> onder = TryIdle

FORM1-> Button1-> onclick = form1-> button3-> onclick;

}

God, can't! How to do! change!

Void __fastcall tform1 :: button2click (TOBJECT * Sender) {form1-> OndblClick = Tryer; Application-> Onder = Tryidle; Form1-> Button1-> onclick = button3click}

Save it is trying, it is okay! Pendant tone!

But why can't you? I do not quite understand!

Check information: TButton OnClick is explained so!

Occurs when the user clicks the control.

__property classes :: TNotifyEvent OnClick = {Read = fonclick, Write = fonclick, stored = isonclickstored};

Description

Use the OnClick event handler to respond when the user clicks the control. If the control has an associated action, and that action has an OnExecute method, the action Zha OnExecute method responds to click events unless it is superseded by an OnClick event handler.Usually Onclick Occurs When THE USER PRESSES AND RELASES The Left Mouse Button with The Mouse Pointer Over The Control. This Event Can Also Occur When

The user selects an item in a grid, outline, list, or combo box by pressing an arrow key. The user presses Spacebar while a button or check box has focus. The user presses Enter when the active form has a default button (specified by THE DEFAULT Property. The User Presses esc When the Active Forms The Accelerator. The user presses the accelerator key for a button or check box.

The CHECKED Property of a Radio Button Is Set To True. The Value of the Checked Property of a check box is change. The click method of a menu item is called.

For A Form, An Onclick Event Occurs When The User Clicks A Blank Area of ​​The Form or on A Disabled Component.

What is TNOTIFYEVENT!

NotifyEvent is used for events trat do not required parameters.

Unit

Classes

TYPEDEF VOID __FASTCALL (__closure * tnotifyeevent) (System :: TobjectTObject * Sender);

Description

The TNotifyEvent type is the type for events that have no event-specific parameters. These events simply notify the component that a specific event occurred. For example, OnClick, which is of type TNotifyEvent, notifies the control that a click event occurred on the control .

The sender parameter is the object whose event handler is caled. For example, .with The onclick event of a button, the sender parameter is the button component what clicked. Oh!

Look, don't! TNOTIFYEVENT is an event that does not require parameters, that sender is a calling handle! Understand, but I understand so much!

转载请注明原文地址:https://www.9cbs.com/read-22682.html

New Post(0)