matej148
matej148

Reputation: 175

gtk# ScrolledWindow - scroll to top

I have ScrolledWindow (inside is a TreeView) and I need to scroll to top. Do you have some idea? Every answer would be very appreciated. Thanks

Upvotes: 2

Views: 2148

Answers (2)

Ross Meikleham
Ross Meikleham

Reputation: 164

In GTK# for a variable named scrollWin of type GtkScrolledWindow

scrollWin.Vadjustment.Value = 0;

Upvotes: 1

ergosys
ergosys

Reputation: 49039

In GTk+ you basically get the vertical adjustment for the scrolled window and use it to set the scroll position. I don't know gtk# details, but here's how in c++ (gtkmm):

 scrollWin.get_vadjustment()->set_value(0);

Gtk# should be similar.

Upvotes: 4

Related Questions