• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 349
  • Last Modified:

use of tPopup menu

I'm not using TSpeedbutton any more like in related question. Now i work with  TShape. I can create while run time new tshape from menu (related question). I need code with options to add hint to TShape (still while app is running) from popupmenu with same dialog window.
0
pr2501
Asked:
pr2501
  • 3
  • 2
1 Solution
 
MerijnBSr. Software EngineerCommented:
something like this?

procedure TForm1.OnMenuItemClick(Sender: TObject);
var NewShape: TShape;
begin
 NewShape := TShape.Create(self);
 NewShape.Parent := Self;
 NewShape.Top := 10;
 NewShape.Left := 10;
 NewShape.Hint := 'a hint for the shape';
end;

Open in new window

0
 
pr2501Author Commented:
Yours code works.


But

NewShape.Hint := Mname;

doesn't work.
 I don't have any error messages because Mname is a string variable.
0
 
MerijnBSr. Software EngineerCommented:
>  I don't have any error messages because Mname is a string variable.
that doesn't make sense.

Show more code please.
0
 
pr2501Author Commented:
thank you
0
 
MerijnBSr. Software EngineerCommented:
The error is gone?
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now