Autor Beitrag
moloch
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 451

Win 2000
D5 Prof
BeitragVerfasst: Mi 01.09.04 13:05 
Hallo,
also das habe ich nicht gefunden. Wie man eine zeile im stringgrid fett schreibt.
Kann da jemand helfen?

mfg
moloch
Aton
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 125

Windows XP
D7 Enterprise
BeitragVerfasst: Mi 01.09.04 13:42 
Hallo du,

ich habe es zwar jetzt nicht durchgeschaut, aber vielleicht steht hier was drin?

home.arcor.de/hardco...nload/stringgrid.pdf

Gruß Jens.
moloch Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 451

Win 2000
D5 Prof
BeitragVerfasst: Mi 01.09.04 13:52 
nein leider steht da nichts drin.
mfg
moloch
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mi 01.09.04 13:59 
Probier mal folgendes im DrawCell-Ereignis des StringGrids:

Beispiel zeigt, wie man die Überschriften fett macht:

if ARow = 0 then
grdProtokoll.Canvas.Font.Style := [fsBold]
else
grdProtokoll.Canvas.Font.Style := [] ;
grdProtokoll.Canvas.TextRect(Rect,Rect.Left+2,Rect.Top+2,grdProtokoll.Cells[ACol,ARow]);
moloch Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 451

Win 2000
D5 Prof
BeitragVerfasst: Mi 01.09.04 14:08 
hey,
dank dir es funktioniert.
also die if else -sache verstehe ich.
aber die letzte zeile ohne die das ganze nicht funktioniert, die kapier ich nicht.
also wofür die ist.

mfg
moloch
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mi 01.09.04 14:27 
grdProtokoll.Canvas.TextRect(Rect,Rect.Left+2,Rect.Top+2,grdProtokoll.Cells[ACol,ARow]);

Damit gibst Du den Text aus, der in der aktuellen Zelle (Cells[ACol,ARow]) des Grids steht (also dass, wo das DrawCell-Ereignis gerade ist.
Da direkt auf dem Canvas gschrieben wird wird dazu noch die genaue Position und Größe des zu zeichnenden Rechtecks (Rect) angegeben.
moloch Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 451

Win 2000
D5 Prof
BeitragVerfasst: Mi 01.09.04 14:37 
danke dir,
bin jetzt schon glücklicher mit meiner stringgrid-ansicht.
mfg
moloch
moloch Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 451

Win 2000
D5 Prof
BeitragVerfasst: Mi 01.09.04 14:38 
sag mal ich mache jetzt ein paar aktionen in drawcell und formresize für das stringgrid.
leider flackert das so hässlich.
kann man dagegen was tun?

mfg
moloch
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mi 01.09.04 14:43 
Versuche mal die Funktionen BeginUpdate und EndUpdate. Ich meine, dass die das Flackern verhindern sollen. Für genauere Erläuterungen must Du aber mal die Hilfe bemühen. Beim ir ist das solange her, dass ich das mal verwendet habe.
grayfox
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 800

win98, winXP
D4 Standard; D6 Personal
BeitragVerfasst: Mi 01.09.04 15:37 
wahrscheinlich änderst du in OnDrawCell den inhalt von einer oder mehreren zellen.
dadurch wird OnDrawCell erneut aufgerufen, die zellen werden neu beschriftet, OnDrawCell wird wieder aufgerufen, usw, usf....

poste deine OnDrawCell mal

mfg, stefan
ps: verwende auch mal die suchfunktion im forum. [ondrawcell]. dort findest du bestimmt unzählige beiträge, die genau dein problem behandeln ;)
grayfox
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 800

win98, winXP
D4 Standard; D6 Personal
BeitragVerfasst: Mi 01.09.04 15:44 
Zitat:
Funktionen BeginUpdate und EndUpdate

nützt dir in diesem fall nichts, das macht nur sinn beim befüllen und leeren von einer grossen anzahl von zellen...

mfg, stefan
moloch Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 451

Win 2000
D5 Prof
BeitragVerfasst: Do 02.09.04 08:17 
es gibt doch gar nicht begin und endupdate bei einem stringgrid!?
mfg
moloch