Docs and questions
4 messages in this thread
Ethan,
When will the documentation for QuickPak for Windows be out? Puzzling it
out from the DOS version manual is like working without a net, especially
since I never used the DOS version.
A couple of questions, not necessarily related to QP but maybe within your
expertise:
1. Is there a way to pass a menu item to a subroutine as a control
argument? For instance, I'd like to pass the name of a menu item to the
caption on a child form with one subroutine, rather than have to write
Form2.Caption =… for every Menu().Click event. When I've tried using
Screen.ActiveControl, I always get "no active control" errors.
2. How can I detect if a ListBox has been scrolled using the scroll bar?
Is there anything analogous to the KeyDown event? Or would it be better to
turn off the scroll bar on the ListBox and create a separate ScrollBar and
use its Change event?
Thanks. And Lee Perryman says, "Hi!"
Sue
Sue, I'll let Don answer this one <smile>:
Sue,
1) Make your menus control arrays. Then you can set a forms caption
as follows:
Sub Menu1_Click (Item) 'One proc for whole menu
Form2.Caption = Menu1(Item).Caption 'Set the form's caption
Select Case Item 'Process menu choices
Case ITEM1
… etc
2) About the only aproach I can think of here is to track the scroll
position manually in the Mouse/KeyDown event procedures. I don't
know of a way to disable the scroll bar on a list box.
To track the index of the item displayed at the top of the displayed
list, use the following code:
Declare Function SendMessage& Lib "user" (ByVal hWnd%, ByVal wMsg%,_
ByVal wParam%, ByVal lParam&)
Const WM_USER = &H400
Const LB_GETOPINDEX = WM_USER + 15
Sub MySub
TopItem = SendMessage&(ControlHWnd(List1), LB_GETOPINDEX, 0, 0)
…
…
Hope this helps,
Don Malin
There is 1 Reply.
Don,
Thanks for the advice. I've pursued your ideas somewhat, with the
following reactions:
1) My menu is already a set of control arrays, grouped so that menu choices
that produce similar events go together. It's three levels deep in spots.
I was hoping to be able to pass the name of each control array to the forms
caption rather than have to use a single control array for the entire menu.
2) Interesting discovery: Clicking on the scroll bar for a list box does
NOT produce a MouseDown or MouseUp event — only clicking in the list
region.
Is there a way to trap the WM_VSCROLL message? Otherwise, I guess the only
way to tell if a listbox has been scrolled is to have a Custom Control
without a scrollbar and use a separate scrollbar.
I see Ethan ducked the docs question. How 'bout just a teensy, weensy
hint?
Sue
There is 1 Reply.
Sue,
Regarding help with Visual Basic in general, your best results will come
from calling our tech support line for help. I'm just getting up to speed
on VB myself now.
I'm sorry if I skipped a question about the manual. What did you ask?
Again, Don Malin is the project leader on QuickPak Professional for
Windows, and he knows best what is going on.
–Ethan <usually more on top of things>