Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Scrollable frame
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00979443
Message ID:
00979474
Vues:
33
>I am looking for a scrollable container activeX control that can scroll child controls. Can somebody help?

This is a PRG classed demo with ascrollable container with controls in the container. It should give you some ideas. Paste it into a PRG and run-it!
* SlideContainerDemo.PRG
PUBLIC frmMain
frmMain=createobject('subfrmMain')
frmMain.Name='frmMain'
frmMain.addobject('SideSlider','subSideSlider','MSComctlLib.Slider.2')
with frmMain.SideSlider
.borderstyle=1
.largechange=5
.max=100
.Orientation=1
.smallchange=1
.tickfrequency=1
.tickstyle=3
.Height=frmMain.Height-frmMain.SideSlider.top-0
endwith
frmMain.Show
*read events
* End 

define class subfrmMain as form 
caption=[Main - Container - Slider Demo]
height=200
minheight=100
showwindow=2
ADD OBJECT cntMain as subcntMain

procedure init
AddItemContainers(thisform.cntMain)
endproc

procedure QueryUnload
CLEAR EVENTS
endproc

procedure resize
thisform.SideSlider.Height=thisform.height-thisform.SideSlider.top
endproc
ENDDEFINE

DEFINE CLASS subcntEdit as Container
height = 88
top=2
left=3
width=590
backcolor=8388863
ADD OBJECT edtBox as subEdit
visible=.t.
ENDDEFINE 

define class subcntMain as Container
height=2702 && Can almost be any thing - vary with number of sub containers
backcolor=rgb(192,192,192)
left=20
top=0
width=600
visible=.t.
enddefine

DEFINE CLASS subEdit as EditBox
height=84
left=2
top=2
width=586
visible=.t.
ENDDEFINE 

define class subSideSlider as olecontrol &&=========================
left=0
top=0
width=20
*!*	max=1000
visible=.t.
procedure Change
thisform.cntMain.Top=-(this.value*thisform.cntMain.Height/100)+this.top
endproc
procedure Scroll
this.change
endproc
enddefine &&class subSideSlider as olecontrol &&====================

procedure AddItemContainers(locntMain) &&---------------------------
FOR c=1 TO 30
lccntItem="_"+RIGHT(STR(10000+c,5),4)
locntMain.addobject(lccntItem,'subcntEdit')
locntItem=eval([locntMain.]+lccntItem)
locntItem.edtBox.Value=lccntItem
locntItem.Top=(c-1)*90+2
ENDFOR
endproc &&AddItemContainers(locntMain) &&---------------------------
Imagination is more important than knowledge
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform