Autor Beitrag
rob87
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 461

Win Me, Win XP Home, Win XP Prof
Delphi 2007 Enterprise
BeitragVerfasst: Mo 22.10.07 11:00 
Hallo,

ich hab in einem Formular ein DBGrid und ein StringGrid.

1.) Problem: Wenn ich nun zuerst etwas in dem DBGrid auswähle und anschließend in dem StringGrid verschwindet der Focus im DBGrid.

2.) Problem: Wenn ich den Focus in beiden Grids hab, möchte ich bei nem ButtonClick die Schriftfarbe verändern


Hat da jemand ne Ahung
JoelH
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 806
Erhaltene Danke: 17

Win10
Delphi Alexandria 11.2 Patch 1
BeitragVerfasst: Di 23.10.07 13:22 
IMHO kann man auf einer Form auch nur eine Komponente haben die den Focus besitzt.

Du kannst dir aber einfach mitschreiben, beim verlassen des DBGrids, welche Zelle aktuell gerade markiert ist und wenn dann im StringGrid was markiert wurde und wenn dann der Button geklickt wird veränderst du halt die Zell die du dir gemerkt hast.

_________________
mfg. Joel
rob87 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 461

Win Me, Win XP Home, Win XP Prof
Delphi 2007 Enterprise
BeitragVerfasst: Di 23.10.07 13:51 
Und wie mach ich des?? ^^
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Di 23.10.07 17:26 
Hallo,

setz die Option dgAlwaysShowSelection bei der Eigenschaft DBGrid.Options auf True.

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )