General discussion

Locked

VB6 DBGrid caption

By C1980 ·
Would someon help show me how to add 2 lines of text to the VB6 DBGrid(DAO) caption. There isn't a property to assign how many caption lines one wants, (like the column headers which has this property). I wonder if this can be done through an API call?
So that is no misunderstanding: the DBGrid caption must show two lines, (or more) so that I can WRAP the text, or ADD the text to a second line. The carraige return doesn't seem to help.

Please note: I want to use the DBGrid delivered with VB6 for DAO - nothing else comes in question for now.

Thanks for any help!

This conversation is currently closed to new comments.

9 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

VB6 DBGrid caption

by amanabala In reply to VB6 DBGrid caption

Hello,
I have faced this problem with VB 5.0 in 1998. I was hoping it would go away in VB 6.0. Since it was not fixed, we have to find workarounds. Not pretty but certainly a viable option. My workaround was to use a label that "locked" with the grid so it moved along with it if needed.

I will continue to try and dig out information regarding this. If I come across anything useful, i will post back. In the meanwhile try the above workaround.

regards,
Ravi <ananth_manabala@yahoo.com>

Collapse -

VB6 DBGrid caption

by C1980 In reply to VB6 DBGrid caption

In addition to my comments above to your answer:
Thank you for you attempt to help me, but 7 weeks have passed since, so I guess you were not successful in finding something else.

Collapse -

VB6 DBGrid caption

by C1980 In reply to VB6 DBGrid caption

To answer #1:

Thanks for answering. This is basically what I am already doing, (with the label), and I am trying to get away from it.....If you find out anything that does that what I asked for then I would be grateful and will award the points. For now I will leave your answer as not rated in case you later find the answer an want to post it as a comment.

Collapse -

VB6 DBGrid caption

by C1980 In reply to VB6 DBGrid caption

Point value changed by question poster.

Collapse -

VB6 DBGrid caption

by C1980 In reply to VB6 DBGrid caption

I am willing to award the points to the person who can solve this problem in some other not-too-complicated fashion - But the DBGrid has to be used, and, if other objects are used then they have to work with the grid easily and the gid and caption still must look like they are the same unit and belong together.
As I said, I am already using a label, and as Answer #1 says - It's not pretty but it works -, but I need it to be pretty AND to work(easily). So any ideas are possible winners now!

Collapse -

VB6 DBGrid caption

by C1980 In reply to VB6 DBGrid caption

Point value changed by question poster.

Collapse -

VB6 DBGrid caption

by sl-campbell In reply to VB6 DBGrid caption

There are no possibilities that I know of to do this with an API call or whatever. There IS a "pretty" solution, and it DOES take a little bit to set up, and it looks just like it is part of the Grid, but once set up it is easy to use. It uses a one label AND a frame. You could go a step further and add all of the properties of the grid to a class, along with your own - such as CaptionLines in order to change the label size, (label caption is centered, bold and uses a carriage return for multiple lines),and you cancapture the Move method to take the actions needed to reposition the frame INSTEAD of the grid. And then one more step further is creating a UserControl.....

E-mail sent with my solution.

Collapse -

VB6 DBGrid caption

by C1980 In reply to VB6 DBGrid caption
Collapse -

VB6 DBGrid caption

by C1980 In reply to VB6 DBGrid caption

This question was closed by the author

Back to Web Development Forum
9 total posts (Page 1 of 1)  

Related Discussions

Related Forums