protected override void WndProc(ref Message m) { this.si.cbSize = Marshal.SizeOf(this.si); this.si.fMask = (int)Win32.ScrollInfoMask.SIF_ALL; if (mDropdown.Handle != null)//((m.Msg == Win32.WM_VSCROLL) || (m.Msg == Win32.WM_SIZE)) { if (Win32.GetScrollInfo(mDropdown.Handle, (int)Win32.ScrollBarDirection.SB_VERT, ref si)) { //int listStyle = Win32.GetWindowLong(mDropdown.Handle, Win32.GWL_STYLE); //listStyle |= Win32.WS_VSCROLL | Win32.WS_HSCROLL; //listStyle |= Win32.WS_VSCROLL; //listStyle = Win32.SetWindowLong(mDropdown.Handle, Win32.GWL_STYLE, listStyle); Win32.RECT r1 = new Win32.RECT(); Win32.GetClientRect(mDropdown.Handle, ref r1); Win32.SetParent(VScrollBar1.Handle, mDropdown.Handle); VScrollBar1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Right))); //VScrollBar1.Dock = DockStyle.Right; VScrollBar1.Location = new Point(r1.Right - 0x13, 0); //0x13 = -19 VScrollBar1.BringToFront(); VScrollBar1.LargeChange = si.nPage; VScrollBar1.Maximum = si.nMax; VScrollBar1.Minimum = si.nMin; VScrollBar1.SmallChange = 1; //VScrollBar1.Update();//.SyncThumbPositionWithLogicalValue(); } //Win32.SetScrollInfo(cbi.hwndList, (int)Win32.ScrollBarDirection.SB_VERT, ref this.si, true); } base.WndProc(ref m); }
protected override void OnDropDown(System.EventArgs e) { base.OnDropDown(e); InitComboBoxInfo(this); Win32.GetClientRect(cbi.hwndList, ref cboListRect); //Win32.SendMessageCb(this.Handle, 0x164, IntPtr.Zero, out cbi); mDropdown = new DropdownWindow(this); mDropdown.AssignHandle(cbi.hwndList); //int listStyle = Win32.GetWindowLong(cbi.hwndList, Win32.GWL_STYLE); //listStyle |= Win32.WS_VSCROLL | Win32.WS_HSCROLL; //listStyle |= Win32.WS_VSCROLL; //listStyle = Win32.SetWindowLong(cbi.hwndList, Win32.GWL_STYLE, listStyle); //Win32.SendMessage(this.cbi.hwndList, (int)Win32.LB_SETHORIZONTALEXTENT, (int)80, (int)IntPtr.Zero); }