Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB 6
|
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 18th, 2008, 11:26 AM
Authorized User
 
Join Date: Oct 2007
Posts: 46
Thanks: 1
Thanked 0 Times in 0 Posts
Send a message via MSN to debbiecoates
Default vb6, datagrid, column, colour

Can anyone point me in the right direction

I am using SQL sever 2000 with vb6

I have several datagrids in the application.

some of my grids are read only, some may have one or two columns that can be edited.

is it possible to change the background colour of a specific column to another colour (to indicate to the user that they can edit this column directly)


I've trawled through the net, and cant seem to get very far

I keep coming accross references to header styles etc, but I cant find enough information to be able to explain it. ()ie a tutorial)

I use something like this to change how my grids look now

With Me.datagrid
    .Columns(0).Visible = False
    .Columns(1).Visible = False
    .Columns(2).Width = 1 'OutPutID
    .Columns(3).Visible = True
    .Columns(3).Caption = "Output"
    .Columns(3).Locked = True
    .Columns(3).Width = 4800
    .Columns(4).Visible = True
    .Columns(4).Width = 1000
    .Columns(4).Alignment = dbgCenter
    .Columns(4).Caption = "Amount"

End With


i would like to be able to do something like

.columns(4) colour = red

or

.columns(4) font = ariel, bold

etc

I would appreciate any pointers

Cheers


 
Old July 21st, 2008, 10:46 AM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

I don't use this control (yet—though from the problems people seem to have with it I fear the day when I'll need to), but what I would do, is, in running-but-breakpointed code, highlight a reference to the datagrid you are working with. Then right-click that highlit region, and select "Add to watchlist" from the context menu.

Then, in the watchwindow, poke around the reference, expanding properties and such, to see if you can find the property or properties that will allow you to accomplish this. (And if you find the answer, post it here... :))
The Following User Says Thank You to BrianWren For This Useful Post:
debbiecoates (December 9th, 2009)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing Datagrid Colour based on the Value vuyiswamb VB.NET 2002/2003 Basics 0 May 22nd, 2008 02:24 AM
Changing Fore colour and back colour darrenb Access VBA 2 May 25th, 2007 07:10 AM
Export the data from datagrid to excel in VB6 Sharad Singh Beginning VB 6 1 April 16th, 2007 06:00 AM
Add a Column to a DataGrid infernokodiak C# 7 January 18th, 2006 04:06 PM
how do i use datagrid in vb6(SP6) zpyral VB Databases Basics 2 May 9th, 2005 04:08 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.