I should be able to pop up a TForm when I click on a TPaintBox (form content where I will be I'm dependent on it). If the user clicks anywhere, then I want to destroy the original form (or at least disappear) if the new click is clicked then the second TPaintBox is right-clicked, a new TForm should appear. Basically, this is a right-click property property type type operation. I. Right-click to get properties of TPaintBox area
It seems more difficult than imagination for me. I tried to destroy the pop-up form, when the pop was deactivated by using a turnout event. As a result, a popup is not being shown.
Here my solution (test and work) ...
Type TForm1 = Class (TForm) ... Private Reference Form: TfrmContext; End; ... Implementation Process TForm1.Button1MouseDown (Sender: Torque; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); Launch if & lt; & Gt; Zero free and Neil (reference); If the button = MBRIT starts then reference form: = TfrmContext.Create (application); ContextForm.SetParentComponent (app); ContextForm.Left: = Mouse Cursor pOS.x; Reference form Top: = Mouse Cursor pOS.Y; ContextForm.Show; End; End; Process TForm1.FormMouseDown (From: TOBject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); Launch if & lt; & Gt; Zero free and Neil (reference); End; In this demo, right-click on button 1 will create your "Contact Form" (which is a TForm) and set its position so that your top-level "Context Form" Sit down properly where your mouse cursor is. Elsewhere on your form, one click will destroy the context form.
Enjoy!
Comments
Post a Comment