DBGrid

Hello
I've two questions:
A. If I want to create a DBgrid, which its colums' width are not equal, how do I do that ?

B. Do you know of a site, which allows to download a progress bar control, what diplays the processes' percent ?
lirongAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
ventondConnect With a Mentor Commented:
A. If you refresh the DBgrid or the Data tool it is bound to, the columns reset.

B. http://www.mvps.org/ccrp

They let you use all the Windows Common Controls individually.
0
 
TimCotteeCommented:
A:

DBGrid1.Columns(0).Width = 400
DBGrid1.Columns(1).Width = 5000

etc

B:

There is a progress bar control in VB6 (Pro and Enterprise certainly, not sure about other versions.)

0
 
TimCotteeCommented:
Other sources you could try are:

http://www.componentsource.com

http://www.davecentral.com

These have all sorts of controls, some free some shareware, others you have to pay full prices for, most have downloadable demos though.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
TimCotteeCommented:
Sorry about the URL links, they don't work properly.

http://www.componentsource.com 
http://www.davecentral.com 
0
 
lirongAuthor Commented:
Hi
I've tried to do, what you've told me but I've two problems:
The first one, that I've more than two colums. The other one, is that when I'm writing the code, there is NO effect on the DBgrid...
0
 
TimCotteeCommented:
The grid will not change in size at design time. So if that is what you are expecting you will not see it.

You can use DBGrid.Columns(n).width = nnn for any column, if you want them all the same you could do:

for intColumn = 0 to DBGrid1.Columns.Count - 1
  DBGrid1.Columns(intColumn).Width = 300
next

The other method that might work and would allow you to see it at design time as well is to use the FormatString property, this sets default column headers and widths (I think so anyway, I don't have VB running at the moment to look at so if it doesn't apply I am sorry).
0
 
lirongAuthor Commented:
Nope

I've tested your code, but the columns' size didn't change. Further more, after I'm writing DBGrid1.colums(0) and then pressing on the "." sign NO help text appear. Maybe I've forgotten to do something ??
0
 
lirongAuthor Commented:
Nope

I've tested your code, but the columns' size didn't change. Further more, after I'm writing DBGrid1.colums(0) and then pressing on the "." sign NO help text appear. Maybe I've forgotten to do something ??
0
 
TimCotteeCommented:
Where did you put the segment of code? The best thing to do with it is probably in the Form_Resize event or at least somewhere that the grid will be affected, if you want to EMail me some example code to TimCottee@Earthling.net I will have a look for you.
0
All Courses

From novice to tech pro — start learning today.