Autor Beitrag
MrKnogge
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 76

Win XP, Win 7
Delphi 7 Prof, Delphi 2005 PE, C# (VS 2008)
BeitragVerfasst: So 22.05.11 11:05 
Hallo Zusammen!

Ich habe in einer Listview mehr Einträge, als angezeigt werden können. Nun möchte ich zu einem bestimmten Eintrag springen, dessen Index ich kenne. Die Delphi-Methode MakeVisible konnte ich unter C# aber nicht finden!?

Viele Grüße & besten Dank!

_________________
MfG MrKnogge
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19341
Erhaltene Danke: 1752

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: So 22.05.11 11:24 
Wie wäre es mit EnsureVisible? ;-)
msdn.microsoft.com/d...w.ensurevisible.aspx
MrKnogge Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 76

Win XP, Win 7
Delphi 7 Prof, Delphi 2005 PE, C# (VS 2008)
BeitragVerfasst: So 22.05.11 11:46 
Ah ok, vielen Dank! Das Problem ist ein anderes. EnsureVisible funktioniert scheinbar nur, wenn Scrollable auf true steht. Ist dies der Fall, bekomme ich beim Hinzufügen neuer Einträge neben dem vertikalen Scrollbalken aber auch den horizontalen, obwohl dieser nicht benötigt werden würde. (daher hatte ich es rausgenommen)

_________________
MfG MrKnogge
Peter Bär
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17
Erhaltene Danke: 1



BeitragVerfasst: Mo 23.05.11 07:14 
Probier mal folgende Funktion:

dataGridView1.FirstDisplayedScrollingRowIndex = IndexdeinerZeile;

Mit dieser Funktion wird die zuerst selektierte Zeile als erste Zeile des DataGridView angezeigt.
Th69
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Moderator
Beiträge: 4807
Erhaltene Danke: 1061

Win10
C#, C++ (VS 2017/19/22)
BeitragVerfasst: Mo 23.05.11 09:40 
Hallo Peter,

da es hier aber um ein ListView-Control geht, lautet die zugehörige Eigenschaft ListView.TopItem ;-)
Jedoch funktioniert diese ebensowenig wie EnsureVisible, wenn Scrollable auf false steht.

MrKnogge, mit welchen 'View' arbeitest du denn in deinem ListView?
MrKnogge Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 76

Win XP, Win 7
Delphi 7 Prof, Delphi 2005 PE, C# (VS 2008)
BeitragVerfasst: Mo 23.05.11 14:32 
@Th69
mit Deteils.

Ich habe aber nun Scrollable wieder auf true gesetzt und nutze EnsureVisible().

Viele Dank euch allen!

_________________
MfG MrKnogge