Dear all,
In my DLL file, I put a listbox and selected both Vertical and Horizontal scroll bar. The source code is:
REDEFINE LISTBOX oLbx FIELDS ID 110 OF oDlg
When I run the application, there is no horizontal scroll bar in the listbox, there is vertical scroll bar only. If I use this code:
@ 1, 1 LISTBOX oLbx FIELDS SIZE 280, 140 OF oDlg without using DLL file, then it works fine.
Does anyone can solve this problem?
ListBox in DLL file
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Dear Enrico,
Thank you for your information, I try to put TWBrowse():lHScroll:= .T. before DEFINE LISBOX, then, I got an Error description: Error Objects/6 No Exp. Method: TWBROWSE:_LHSCROLL.
Do you have any suggestion?
Thank you for your information, I try to put TWBrowse():lHScroll:= .T. before DEFINE LISBOX, then, I got an Error description: Error Objects/6 No Exp. Method: TWBROWSE:_LHSCROLL.
Do you have any suggestion?
Last edited by tsai8839 on Mon Sep 18, 2006 12:57 pm, edited 1 time in total.
Regards,
Andy Tsai
Andy Tsai
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Andy,
This is from my notes:
So the solution is that you have to add a custom control named "TWBrowse" to Workshop, then redefine that in your code instead of using the "listbox" in Workshop.
James
This is from my notes:
There something else to consider. The listbox in Workshop is NOT the same listbox we use as a browse. We use the term "listbox" as the command in our code, but the preprocessor changes it to call our TWBrowse class. Note that you can actually define a "listbox" in Workshop and it will work kind-of in your code, but it will have problems.To turn off the scrollbars do:
// Turn off the horizontal
oLbx:oHScroll:setRange( 0, 0 )
oLbx:oHScroll:= Nil
// Turn off the vertical
oLbx:oVScroll:setRange( 0, 0 )
oLbx:oVScroll:= Nil
Setting oLbx:nStyle does not seem to have any effect.
For horizontal scrolling you will also need to freeze all the columns due to a bug. When you turn off horizontal scrolling then click on the last column it still scrolls one column to the right. Freezing all the columns fixes this.
oLbx:nFreeze:= 5 // or whatever no. of columns you have.
So the solution is that you have to add a custom control named "TWBrowse" to Workshop, then redefine that in your code instead of using the "listbox" in Workshop.
James