Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Modal form and listview
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Miscellaneous
Thread ID:
00723604
Message ID:
00724136
Views:
91
>It's ActiveX Listview.

Try this code in a "test.prg" - The form is a show window / modal. Left clicks will select a node, right clicks will pop a message and I got it to work on VFP 6. I would be interested if it worked for you.
* test.prg
* ListView mouse down with left right click on ListView
CLOSE ALL
CLEAR ALL
RELEASE ALL
ON ERROR
SET EXACT ON
PUBLIC frmTest
ON ERROR DO ResetError

* Top of GUI
frmTest=CREATEOBJECT('clsForm')
WITH frmTest
.ADDOBJECT('ocxListView','xclsListView','MSComctlLib.ListViewCtrl.2')
WITH .ocxListView
.FONT.SIZE=8
.TOP=100
.HEIGHT=200
.LEFT=50
.WIDTH=300
.labelwrap=.F.
.labelEdit=0
.VIEW=3
.HIDESELECTION=.F.
.AllowColumnReorder=.T.
.FullRowSelect=.T.
.COLUMNHEADERS.ADD(,[SOME_KEY],[Sample List View Nodes],278,,)
.LISTITEMS.ADD(,[A],[Sample node A],,)
.LISTITEMS.ADD(,[B],[Sample node B],,)
.LISTITEMS.ADD(,[C],[Sample node C],,)
.LISTITEMS.ADD(,[D],[Sample node D],,)
.LISTITEMS.ADD(,[E],[Sample node E],,)
.VISIBLE=.T.
ENDWITH &&.ocxListView
ENDWITH && frmTest
frmTest.SHOW
CLEAR EVENTS
CANCEL
ON ERROR
CLOSE ALL
CLEAR ALL
RELEASE ALL
* -- End of GUI

* Clesses and procedures
DEFINE CLASS xclsListView AS OLECONTROL
procedure mousedown(button, shift, x, y)
IF button=2 && Right Button
   messagebox([Right MouseDown ]+this.selecteditem.text, [Mousedown])
Endif
endproc
ENDDEF

DEFINE CLASS clsForm AS FORM &&--------------------------------------
AUTOCENTER=.T.
SHOWWINDOW= 1 && ShowWindow
WINDOWTYPE=1 && Modal
WIDTH=400
HEIGHT=400
BORDERSTYLE=2
CAPTION=[Right Mouse Click Test on ListView for MODAL form]
PROCEDURE QUERYUNLOAD
THIS.RELEASE
ENDPROC
ENDDEF &&-----------------------------------------------------------

PROCEDURE ResetError
ON ERROR
MESSAGEBOX([Ooops! an Error!])
ON ERROR DO ResetError
ENDPROC
* Terry
Imagination is more important than knowledge
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform