Interactively experimenting with controls: the Slider

I have a simple form that can show an individual photograph, or at the push of a button, show an array of thumbnails. It is a simple client front end for my collection of about 18000 digital photos and home movies. The thumbnail view shows about 100 pictures, depending on the screen resolution. I can query for “wendy” or “christmas” to execute a SQL Select statement to see a subset of all the photos for a particular person or event.

For the array view, there could be thousands in the result set, so I wanted to add a slider control (like a scrollbar) so I could move from one end to the other easily. I created a new Form and added an ActiveX control to it. A dialog came up from which I could select a control. “Microsoft Slider Control version 6.0” sounded promising. Inspecting the property sheet I saw that the “oleclass” property was “MSComctlLib.Slider.2”. You can right click and choose Zoom to copy the string to the clipboard.

I wanted to experiment with that control interactively, so I typed this in the command window.

x=CREATEOBJECT("form")

x.Visible=1

x.AddObject("oSlider","olecontrol","MSComctlLib.Slider.2")

x.oSlider.Visible=1

I could just type “x.oslider.” Immediately after the “.”, intellisense would show various properties available. If I choose “object” from that list, then the intellisense would be only those properties that are unique to the control (like “LargeChange”, and not the ActiveX control container (like “top”).

Intellisense and the interactive command window allowed me to learn quickly which properties I could use for my application. I could change a property’s value and instantly see it affect the control on the form. It took only a minute or two to get the functionality I wanted.

BTW, I really don’t like it when a dropdown menu shows about 7 items of many dozen possible choices. The original Windows design guidelines When using intellisense especially, I’d like to be able to see many more choices at the same time. VFP allows this to be changed by setting the “List Display Count” from the Tools->Options->View dialog.

Here are a couple other common controls to experiment with:

            ListView: MSComctlLib.ListViewCtrl.2

            TreeView: MSComctlLib.TreeCtrl.2