AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Popup

Ein Thema von Prym · begonnen am 9. Mär 2005 · letzter Beitrag vom 9. Mär 2005
Antwort Antwort
Prym

Registriert seit: 20. Feb 2005
108 Beiträge
 
#1

Popup

  Alt 9. Mär 2005, 21:59
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;
  Mit Zitat antworten Zitat
Benutzerbild von Nikolas
Nikolas

Registriert seit: 28. Jul 2003
1.528 Beiträge
 
Delphi 2005 Personal
 
#2

Re: Popup

  Alt 9. Mär 2005, 22:05
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;
Erwarte das Beste und bereite dich auf das Schlimmste vor.
  Mit Zitat antworten Zitat
Prym

Registriert seit: 20. Feb 2005
108 Beiträge
 
#3

Re: Popup

  Alt 9. Mär 2005, 22:19
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;
  Mit Zitat antworten Zitat
Prym

Registriert seit: 20. Feb 2005
108 Beiträge
 
#4

Re: Popup

  Alt 9. Mär 2005, 22:21
ah es geht close
  Mit Zitat antworten Zitat
Benutzerbild von Binärbaum
Binärbaum

Registriert seit: 19. Jan 2005
Ort: Elstra
764 Beiträge
 
Delphi 7 Enterprise
 
#5

Re: Popup

  Alt 9. Mär 2005, 23:56
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
There are exactly 10 kinds of people: those who understand binary, and those who don't.
---
"Software reift beim Kunden. Bei Hardware ist es anders: Hardware fault beim Kunden." - Rainer G. Spallek
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 04:59 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz