Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mouse Scroll in combobox Dropdown
Message
From
27/12/2017 11:05:46
 
 
To
27/12/2017 09:19:08
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
01656760
Message ID:
01656763
Views:
75
*by default the combo shows a scrollbar if its items are >1
*you can set combo.displaycount to set the visible items on combo (by defaut its 0 corresponding to max 7 items)
*here can mouseWheel on the area of combo (not on items) to dropdown the combo and scroll its items  (see attached)
*can set the increment to scroll (here xincrement=1)
*can scroll the same combo by mouseWheel out on the form.
*this is a test

Public oform
oform=Newobject("ycombo_mouse")
oform.Show
Return

*
Define Class ycombo_mouse As Form
  Top = 0
  Left = 0
  Height = 399
  Width = 401
  Caption = "MouseWheel a combo"
  Name = "Form1"

  Add Object combo1 As ComboBox With ;
    Height = 37, ;
    Left = 60, ;
    Top = 24, ;
    Width = 181, ;
    Name = "Combo1"

  Procedure MouseWheel
    Lparameters nDirection, nShift, nXCoord, nYCoord
    Thisform.combo1.MouseWheel(nDirection)  &&can interact with combo from form.mousewheel
  Endproc

  Procedure combo1.MouseWheel
    Lparameters nDirection, nShift, nXCoord, nYCoord
    Local m.xincrement
    m.xincrement=1

    If nDirection<0
      This.Value=This.Value+m.xincrement
      Keyboard "{f4}"  &&drop down the combo
    Endi

    If nDirection>0
      This.Value=This.Value-m.xincrement
      Keyboard "{f4}" &&drop down the combo
    Endi
  Endproc

  Procedure combo1.Init
    With This
      For i=1 To 100
        .AddItem(Trans(i)+"  blablabla")
      Endfor
      .ListIndex=1
      .Style=2
      .Value=1
    Endwith
  Endproc

Enddefine
*
*-- EndDefine: ycombo_mouse
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform