Autor Beitrag
hansg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 168

Win XP Professional SP3, Vista Ultimate 32 SP1
Delphi 6 Professional
BeitragVerfasst: So 04.11.07 11:25 
Hallo zusammen,

ich habe folgendes Problem:
Ich möchte die Options eines Stringgrids im Programm verändern.
Das Grid befindet sich auf dem Form1, ich möchte aber innerhalb von Form3 die Options ändern.
Setze ich die Parameter im Form1 funktioniert es.
Irgendwie klappt das nicht, hat jemand einen Tip?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
procedure TForm3.Button5Click(Sender: TObject);
begin
  form1.StringGrid1.Options:=form1.StringGrid1.Options + [goRowSelect];
end;

procedure TForm3.Button6Click(Sender: TObject);
begin
  form1.StringGrid1.Options:=form1.StringGrid1.Options - [goRowSelect];
end;

_________________
Gruß Hans
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: So 04.11.07 12:42 
Hi!
Du hast Unit1 in der Unit-Klausel von Unit3 (Form3) ?
Welche Fehlermeldung erscheint?

grüße,
Marc
hansg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 168

Win XP Professional SP3, Vista Ultimate 32 SP1
Delphi 6 Professional
BeitragVerfasst: So 04.11.07 12:58 
Hallo,
ist drinn.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
var
  Form3: TForm3;

implementation

uses Unit1;

{$R *.dfm}


Folgende Melungen kommen:


[Fehler] Unit3.pas(73): Undefinierter Bezeichner: 'goRowSelect'
[Fehler] Unit3.pas(73): Inkompatible Typen: 'TGridOption' und 'Integer'
[Fataler Fehler] Testprogramm.dpr(16): Verwendete Unit 'Unit3.pas' kann nicht compiliert werden

_________________
Gruß Hans


Zuletzt bearbeitet von hansg am So 04.11.07 14:02, insgesamt 2-mal bearbeitet
dummzeuch
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 593
Erhaltene Danke: 5


Delphi 5 ent, Delphi 6 bis Delphi XE8 pro
BeitragVerfasst: So 04.11.07 13:41 
user profile iconhansg hat folgendes geschrieben:

[Fehler] Unit3.pas(73): Undefinierter Bezeichner: 'goRowSelect'

Schonmal drueber nachgedacht, was der Compiler Dir damit sagen will?

Tipp: Ctrl-Click auf den goRowSelect in der compilierenden Version (also in Form1) liefert Dir die Unit, in der es deklariert wird. IIRC "Grids". Die dann zur Uses-Anweisung in Unit3 hinzufuegen....

twm
hansg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 168

Win XP Professional SP3, Vista Ultimate 32 SP1
Delphi 6 Professional
BeitragVerfasst: So 04.11.07 13:59 
user profile icondummzeuch hat folgendes geschrieben:

Schonmal drueber nachgedacht, was der Compiler Dir damit sagen will?

Tipp: Ctrl-Click auf den goRowSelect in der compilierenden Version (also in Form1) liefert Dir die Unit, in der es deklariert wird. IIRC "Grids". Die dann zur Uses-Anweisung in Unit3 hinzufuegen....

twm


Bitte um nähere Erkärung

_________________
Gruß Hans
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: So 04.11.07 14:09 
Das Problem besteht darin, dass Du versucht auf Proceduren, Funktionen etc. zuzugreifen, die in einer anderen Unit stehen, welche aber deine Unit3 imo nicht kennt.
Hierbei handelt es sich um die Unit Grids! Wie Du herausfinden kannst, welche Unit Du einzubinden hast, hat user profile icondummzeuch dir bereits beschrieben. ;)

grüße,
Marc
hansg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 168

Win XP Professional SP3, Vista Ultimate 32 SP1
Delphi 6 Professional
BeitragVerfasst: So 04.11.07 14:20 
Danke für die Infos,

leider komme ich hiermit nicht weiter:

Ctrl-Click auf den goRowSelect in der compilierenden Version (also in Form1) liefert Dir die Unit

verstehe ich irgendwie nicht

_________________
Gruß Hans
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: So 04.11.07 14:25 
Strg (=CTRL) gedrückt halten und auf das entsprechende Wort im Code klicken.
Wird in der Regel dabei rot unterstrichen. Du landest daraufhin automatisch in der Unit, aus der das Codewort stammt.

grüße,
Marc
hansg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 168

Win XP Professional SP3, Vista Ultimate 32 SP1
Delphi 6 Professional
BeitragVerfasst: So 04.11.07 14:30 
user profile iconMarc. hat folgendes geschrieben:
Strg (=CTRL) gedrückt halten und auf das entsprechende Wort im Code klicken.
Wird in der Regel dabei rot unterstrichen. Du landest daraufhin automatisch in der Unit, aus der das Codewort stammt.

grüße,
Marc


Danke,

jetzt weiß ich was gemeint war.
Habe das Problem gelöst, bei Uses Grids hizugefügt.

_________________
Gruß Hans