|
-
Dec 25th, 1999, 01:52 AM
#1
Thread Starter
Addicted Member
Can you change a Dbgrid Col width
-
Dec 25th, 1999, 07:48 AM
#2
Hyperactive Member
Hi, Scott! Merry Christmas.
At design time you can set columns width in Property Page, Layout Tab. If you don't want the user be able to change the size of column , uncheck AllowSizing.
At run time:
Dim Co As Column
Dim Co1 As Column
Set Co = DBGrid1.Columns(0)
Set Co1 = DBGrid1.Columns(1)
Co.Width = 1000
Co1.Width = 2000
Hope it will help you.
Larisa
-
Jan 17th, 2000, 09:39 PM
#3
Thread Starter
Addicted Member
Sorry LG but this did not change the Col Width
-
Jan 17th, 2000, 11:23 PM
#4
Hyperactive Member
Try this:
DBGrid1.row = 1
DBGrid1.colwidth(0) = "2000"
This would set the col width of the first col, 2 row.
-
Jan 17th, 2000, 11:49 PM
#5
You can try this with dbgrid 5 or higher..
' item 0 is the first column
DBGrid1.Columns.Item(0).Width = 1000
-
Jan 18th, 2000, 03:26 AM
#6
Thread Starter
Addicted Member
No not yet. I not sure where ya'll came up with combination of property but they don't belong together.
-
Jan 18th, 2000, 03:35 AM
#7
Hyperactive Member
lol, well you can't fault us for trying :-) What version of VB are you using? And which DBGrid? The one that ships with VB or a different one?
-
Jan 18th, 2000, 03:39 AM
#8
Hyperactive Member
I just tried this and it worked fine:
grdSamples.ColWidth(0) = grdSamples.ColWidth(0) + 1000
I put this in a button and each time it would add 1000 to it. How does it not work on yours?
-
Jan 18th, 2000, 11:58 AM
#9
Thread Starter
Addicted Member
I thank you for your help. I am using VB5
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|