Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

C#: Enter-Taste in Grid

Empfohlene Antworten

Veröffentlicht

Hallo!!

Ich hoffe mir kann jemand helfen ich verstehe das problem was ich hab überhaupt nicht! Ich hoffe auch das ich es so schildern kann das ihr es auch versteht!

Also:

Ich hab ein Tabelle: Spalte Von und Spalte Bis. Standardeinstellung sind das in der ersten Zeilte in der Spalte Von eine 1 steht und in Spalte Bis steht ein plus

Am anfang steht mein Cursor in der 1 Zeile auf Spalte Von. Drücke ich nun die Enter - Taste springt der Cursor auf die Spalte Bis. Wenn ich nun nochmal Enter - Taste drück soll der Cursor in die 2 Zeile auf Spalte Von springen und den Wert der Spalte Von in der ersten Zeile + eins nehmen und in die 2 Zeile auf Spalten von springen!! usw..

Ich hoffe das war jetzt einigermassen verständlich! Einfach zweimal lesen dann wirds glaube klarer.

So nun kommt das problem:

Es funktioniert wenn ich einen Breakpoint auf die Methode sezte. Wenn ich das nicht mache funktioniert es nicht!! kapiert das jemand??

Hier der Quellcode:


int iKey = e.KeyValue;

[COLOR=DarkRed]if(iKey == 13)  // Return[/COLOR]

{

   int iAktRow = fpKontaktGrid.Sheets[0].ActiveRowIndex;

   int iAktCol = fpKontaktGrid.Sheets[0].ActiveColumnIndex;


   if(iAktCol == 0)

  {

	fpKontaktGrid.Sheets[0].SetActiveCell(iAktRow,iAktCol+1);


  }

  else

  {

       System.EventArgs eg = null;


       [COLOR=DarkGreen]if(iAktRow+1 == iAnzahl) // Letze Zeile[/COLOR]

             BtnNew_Click(0, eg);

       else

       {

	fpKontaktGrid.Sheets[0].SetActiveCell(iAktRow+1,0);

       }

  }

}

Denn Breakpoint setzt ich immer auf die gleiche Zeile (rot). Wenn ich ihn nicht setzt kommt der Compiler anscheinend gar nicht erst in die Methode da ich mal einen Breakpoint woanders (grün) gesetzt hab.

Bitte bitte helft mir ich werd noch .....

Für weitere fragen steh ich natürlich zur verfügung!!

Danke schon mal!! :e@sy

Hallo,

in welchem Ereignis steht deine funktion ?

Schreibe deine Funktion in das "KeyPress" Ereignis und test das ganze nochmal

Du musst dazu die Zeile "int iKey = e.KeyValue;" in "int iKey = e.KeyChar;" ändern.

.

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.