Autor Beitrag
Grimsch
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 34



BeitragVerfasst: So 13.12.09 14:37 
huhu da ich ja gerade ein Sudoku programmiere würde ich noch gerne wissen ob man ein Stringgrid auf bestimmte zahlen begrenzen kann. Also am besten so dass man nur die zahlen 1-9 eingeben kann und bei jeder anderen zahl oder buchstabe eine Meldung erscheint dass dies kein gültiges Zeichen ist. wäre super wenn mir jemand helfen kann :)


Moderiert von user profile iconNarses: Topic aus Delphi Language (Object-Pascal) / CLX verschoben am So 13.12.2009 um 23:38
Dude566
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1592
Erhaltene Danke: 79

W8, W7 (Chrome, FF, IE)
Delphi XE2 Pro, Eclipse Juno, VS2012
BeitragVerfasst: So 13.12.09 14:41 
Also ich wüsste nicht das es geht aber du kannst dir ja selber was schreiben was die Eingaben überprüft wie hier www.delphipraxis.net/topic150990.html.

_________________
Es gibt 10 Gruppen von Menschen: diejenigen, die das Binärsystem verstehen, und die anderen.
Grimsch Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 34



BeitragVerfasst: So 13.12.09 15:18 
hmm da blick ich irgendwie nicht durch >.<
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: So 13.12.09 15:38 
Hoffnungs-Link statt Antwort ist auch gut. :lol:
ausblenden Delphi-Quelltext
1:
2:
if not (Key in ['0'..'9']) then
    key := #0;


Dieser sagenhafte Quelltext muss lediglich in das OnKeyPress-Ereignis des Stringgrids eingefügt werden und fertig. Natürlich kann da auch noch Fehlermeldung rein.

_________________
Gruß
Hansa
ffgorcky
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 573

WIN XP/2000 & 7Prof (Familie:Win95,Win98)

BeitragVerfasst: So 13.12.09 16:30 
Natürlich müsstest Du dann dort aber
if not (Key in ['1'..'9']) then
hinschreiben, da eine Null dort ja auch nichts zu suchen hat.
Grimsch Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 34



BeitragVerfasst: So 13.12.09 17:19 
ok vielen dank funktioniert^^
Grimsch Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 34



BeitragVerfasst: Mo 14.12.09 15:34 
könnte mir bitte noch kurz jemand sagen was genau die #0 zu bedeuten hat? also in verbindung mit der # :)
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: Mo 14.12.09 16:04 
Du kannst auch chr (0) schreiben. Zumindest das wird sich in der Hilfe schnell finden. 8)

_________________
Gruß
Hansa
Grimsch Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 34



BeitragVerfasst: Mo 14.12.09 16:20 
hmm irgendwie nicht nee^^ ich find zumindest nichts