ListBox in DLL file

ListBox in DLL file

Postby tsai8839 » Mon Sep 18, 2006 12:39 am

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?
Regards,

Andy Tsai
tsai8839
 
Posts: 22
Joined: Mon Jul 24, 2006 6:45 am

Postby dutch » Mon Sep 18, 2006 4:29 am

Dear Andy,

Put following line before DEFINE LISTBOX
TWBrowse():lHScroll:= .T.

Regards,
Dutch
User avatar
dutch
 
Posts: 1542
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Postby tsai8839 » Mon Sep 18, 2006 6:14 am

Dear Dutch,

Thanks a lot for your help.
Regards,

Andy Tsai
tsai8839
 
Posts: 22
Joined: Mon Jul 24, 2006 6:45 am

Postby Enrico Maria Giordano » Mon Sep 18, 2006 12:26 pm

dutch wrote:Dear Andy,

Put following line before DEFINE LISTBOX
TWBrowse():lHScroll:= .T.

Regards,
Dutch


As far as I know, there is no lHScroll instance variable in TWBrowse class.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8716
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby tsai8839 » Mon Sep 18, 2006 12:52 pm

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?
Last edited by tsai8839 on Mon Sep 18, 2006 12:57 pm, edited 1 time in total.
Regards,

Andy Tsai
tsai8839
 
Posts: 22
Joined: Mon Jul 24, 2006 6:45 am

Postby Enrico Maria Giordano » Mon Sep 18, 2006 12:55 pm

You should try to put it after REDEFINE LISTBOX FIELDS command.

It should not work anyway.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8716
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby tsai8839 » Mon Sep 18, 2006 1:09 pm

Dear Enrico,

Now I try to put it after REDEFINE LISTBOX FIELDS command and It has occurs the same error description. Do you have better way to fix it?
Regards,

Andy Tsai
tsai8839
 
Posts: 22
Joined: Mon Jul 24, 2006 6:45 am

Postby James Bott » Mon Sep 18, 2006 1:35 pm

Andy,

This is from my notes:

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.


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.

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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby dutch » Mon Sep 18, 2006 4:37 pm

Dear All,

Sorry, this Twbrowse():lHScroll instance is from TWbrowse classes of Hernan Ceccarelli.

Best Regards,
Dutch
User avatar
dutch
 
Posts: 1542
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Postby tsai8839 » Tue Sep 19, 2006 12:40 pm

Dear James,

Thank you very much for your help. It works fine now.

I also would like to thank all who gave me a hand.
Regards,

Andy Tsai
tsai8839
 
Posts: 22
Joined: Mon Jul 24, 2006 6:45 am


Return to FiveWin for CA-Clipper

Who is online

Users browsing this forum: No registered users and 12 guests