![]() |
Caption Drag Drop ?
Hallo,
Ich habe folgendes Problem. Ich will per drag drob, die caption eines Button an einen anderen Button übergeben das Klappt auch super Wie bekomme ich die caption auf den anderen Button? also so meine ich das. BUTTON1 BUTTON2 ------- = ------- BUTTON2 BUTTON1 Mein Code:
Delphi-Quellcode:
Gruß Berndprocedure TForm1.Button1DragDrop(Sender, Source: TObject; X, Y: Integer); begin if (Source is TButton) and (Sender is TButton) then begin Button1.Caption:= TButton(Source).Caption; end; end; procedure TForm1.Button1DragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean); begin Accept:= (Source is TButton); end; procedure TForm1.Button1StartDrag(Sender: TObject; var DragObject: TDragObject); var pt: TPoint; begin if Sender is TButton then begin pt:= TButton(Sender).ScreenToClient(Mouse.CursorPos); TButton(Sender).Tag:= MakeLong(pt.X, pt.Y); end; end; |
Re: Caption Drag Drop ?
Da musst du die eine Captionzwischenspeichern
Delphi-Quellcode:
Gruß Matthias
procedure TForm1.Button1DragDrop(Sender, Source: TObject; X, Y: Integer);
var a:string; begin if (Source is TButton) and (Sender is TButton) then begin a:=Button1.caption; Button1.Caption:= TButton(Source).Caption; TButton(Source).Caption:=a; end; end; Edit: was vergessen |
Re: Caption Drag Drop ?
Danke dir Klappt super.
Gruß Bernd |
Alle Zeitangaben in WEZ +1. Es ist jetzt 01:33 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 by Thomas Breitkreuz