Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Popup (https://www.delphipraxis.net/41868-popup.html)

Prym 9. Mär 2005 21:59


Popup
 
allso ich habe dank der dp schon rausbekommen wie ich ein popup öffne

das problem ist ich möchte das es nur mit der linken maustaste geöffnet wird aber immoment wird es mit beiden geöffnet

hier das wie ich das gemacht habe

Delphi-Quellcode:
procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var LCursorPos: TPoint;
begin
  GetCursorPos(LCursorPos);
  PopupMenu1.Popup(LCursorPos.X, LCursorPos.Y)
end;

Nikolas 9. Mär 2005 22:05

Re: Popup
 
Schau dir mal den TMouseButton an, der dir da mitgeliefert wird:

Delphi-Quellcode:
procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
if button=MBright then showmessage('rechts');
if button=MBleft then showmessage('links');
end;

Prym 9. Mär 2005 22:19

Re: Popup
 
entschuldigung ich verstehe das nicht ich kenne delphi auch noch nicht so lange

ich habe das so probiert kommt aber das selbe raus deswegen wäre ich eine genauere hilfe nicht abgelehnt


Delphi-Quellcode:
procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var LCursorPos: TPoint;
begin
  if button=MBright then showmessage('rechts');
  begin
    GetCursorPos(LCursorPos);
  PopupMenu1.Popup(LCursorPos.X, LCursorPos.Y);
  end;
if button=MBleft then showmessage('links');
end;

Prym 9. Mär 2005 22:21

Re: Popup
 
ah es geht close

Binärbaum 9. Mär 2005 23:56

Re: Popup
 
Zitat:

Zitat von Prym
entschuldigung ich verstehe das nicht ich kenne delphi auch noch nicht so lange

ich habe das so probiert kommt aber das selbe raus deswegen wäre ich eine genauere hilfe nicht abgelehnt


Delphi-Quellcode:
procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var LCursorPos: TPoint;
begin
  if button=MBright then showmessage('rechts');
  begin
    GetCursorPos(LCursorPos);
  PopupMenu1.Popup(LCursorPos.X, LCursorPos.Y);
  end;
if button=MBleft then showmessage('links');
end;

Evtl. so:
Delphi-Quellcode:
procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
var LCursorPos: TPoint;
begin
  if button=MBleft then
  begin
    showmessage('links');
    GetCursorPos(LCursorPos);
    PopupMenu1.Popup(LCursorPos.X, LCursorPos.Y);
  end
  else if button=MBright then showmessage('rechts');
end;
MfG
Binärbaum


Alle Zeitangaben in WEZ +1. Es ist jetzt 09:20 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz