AGB  ·  Datenschutz  ·  Impressum  







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

Überprüfen ob Text auf Form selektiert ist

Ein Thema von s.h.a.r.k · begonnen am 6. Feb 2006 · letzter Beitrag vom 6. Feb 2006
Antwort Antwort
Benutzerbild von s.h.a.r.k
s.h.a.r.k

Registriert seit: 26. Mai 2004
3.159 Beiträge
 
#1

Überprüfen ob Text auf Form selektiert ist

  Alt 6. Feb 2006, 12:28
Hallo.

Ich habe grad ein kleineres Problem mit meinem MainMenu: Und zwar hab ich da auch ein Bearbeiten-Item, in dem die Subitems Kopieren, Einfügen und Ausschneiden sind. Nun habe ich schon die Unit clipbrd eingebunden und beim OnPopUp-Ereignis folgendes eingetragen:
Delphi-Quellcode:
...
PasteItem.Enabled := Clipboard.HasFormat(CF_TEXT);
...
Das klappt ja auch so weit ganz gut, nur jetzt will ich auch, dass das entsprechend beim CopyItem und CutItem auch so ist, nur abhängig davon ob ein Text auf meiner Form markiert ist oder nicht (in Edits oder in Memos). Nun habe ich aber recht viele Edits auf meiner Form und somit das Problem, dass ich sie nicht einzeln ansprechen will (zu viel Arbeit)...

Ich habe da auch schon mit den EM-Messages (EM_GETSEL, EM_GETSELTEXTEX...) herumhantiert, nur konnte ich dabei leider auch keinen Erfolg verzeichnen.

Ich hoffe, dass ihr mir weiter helfen könnt!

mfg shark
»Remember, the future maintainer is the person you should be writing code for, not the compiler.« (Nick Hodges)
  Mit Zitat antworten Zitat
Benutzerbild von Lannes
Lannes

Registriert seit: 30. Jan 2005
Ort: Münster
745 Beiträge
 
Delphi 3 Professional
 
#2

Re: Überprüfen ob Text auf Form selektiert ist

  Alt 6. Feb 2006, 13:04
Hallo,

ActiveControl hilft da weiter, etwa so:
Delphi-Quellcode:
If (ActiveControl.InheritsFrom(TCustomEdit)) and
   (TCustomEdit(ActiveControl).SelLength > 0) then
   //alles ok
damit erreichst Du alle Edits, Memos, Richedits ...
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
  Mit Zitat antworten Zitat
Benutzerbild von s.h.a.r.k
s.h.a.r.k

Registriert seit: 26. Mai 2004
3.159 Beiträge
 
#3

Re: Überprüfen ob Text auf Form selektiert ist

  Alt 6. Feb 2006, 14:59
Hab ich ausprobiert und hat sofort funktioniert!

Echt klasse!!!
»Remember, the future maintainer is the person you should be writing code for, not the compiler.« (Nick Hodges)
  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 02:38 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