You can get it, or set it, through pinvoke. The code below shows how to get
the top index for a ComboBox.
using System.Runtime.InteropServices;
private const int CB_ERR = -1;
private const int CB_GETTOPINDEX = 0x015b;
private const int CB_SETTOPINDEX = 0x015c;
[DllImport("User32.dll")]
private static extern int SendMessage(IntPtr hWnd, int wMsg, int wParam, int
lParam);
....
int topIndex = SendMessage(this.comboBox1.Handle, CB_GETTOPINDEX, 0, 0);
if (topIndex != CB_ERR)
{
// Do something with "topIndex".
}
else
{
// Error
}
--
Tim Wilson
..Net Compact Framework MVP
"Alex K." <Al***@discussions.microsoft.com> wrote in message
news:48**********************************@microsof t.com...
Thanks, Tim.
That's the problem: I need it mostly for ComboBox! Is there an uneasy way?
"Tim Wilson" wrote:
Have a look at the TopIndex property of the ListBox. I don't think that
the ComboBox has an easy property like this.
--
Tim Wilson
..Net Compact Framework MVP
"Alex K." <Al***@discussions.microsoft.com> wrote in message
news:23**********************************@microsof t.com... How do I get the index of the first displayed item in list box / combo
box? Thank you