Solved

Visual Basic 6 modify datagrid coloumn properties

Posted on 2003-11-19
7
2,642 Views
Last Modified: 2007-12-19
Hi experts there,

I've got a couple of problems..... here they are

I wish to change the coloumn headers of Data Grid with my desired headers, how can I??? and same in MSFlexGrid

I wish to get the max value of a particular field from table so that I can increment it and display it on a text box. How can I???

Can I change the Progress Bar Colour. How?????

Please help me.....

Note: I am using ADODC controller
0
Comment
Question by:hindoddiravikumar
  • 2
  • 2
7 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 250 total points
ID: 9777429
Hi hindoddiravikumar,

If you have bound your datagrid to the data source of the ADO Data control there are a couple of ways to change the column headers, the easiest is to do it in the SQL statement that generates the recordset:

Instead of "Select * From MyTable" use "Select MyField1 As [My Primary Key Field], MyField2 As [My Information Field] From MyTable"

To get the maximum value from a field use:

Select Max(MyFieldName) From MyTable

The standard progress bar in the ms windows common controls library doesn't allow you to change the colour, you can however use the Common Controls Replacement Project progress bar from http://www.mvps.org/ccrp which does have a .FillColor property which permits this. It also has a greatly enhanced range of properties and methods but is backwards compatible with the standard progress bar.


Tim Cottee MCSD, MCDBA, CPIM
Brainbench MVP for Visual Basic
http://www.brainbench.com
0
 
LVL 9

Assisted Solution

by:bhagyesht
bhagyesht earned 250 total points
ID: 9778188
flexgrid: change by using alias in the sql
flexgrid: MSFlexGrid1.FormatString = "bhagyesh|trivedi" note that here the column seperator is a pipe symbol
Max value as TimCottee said fire a select max(<fieldname>) from <tablename>
progress bar color : u need to use API simpler will be to make a user control and use it. progress bar will increase ur deployment size . in a user control add a a line control and change the length.
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 9778213
Also a note on the flexgrid, .FormatString property can be used but as the headers are in row 0 you can also use:

MSFLexgrid1.TextMatrix(0,1) = "Hello"
MSFLexgrid1.TextMatrix(0,3) = "Goodbye"
0
 
LVL 9

Expert Comment

by:bhagyesht
ID: 9778220
for a ready code of progress bar ocx

http://fred.just.free.fr/commun/activex/ProgressBar.zip
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is an explanation of a simple data model to help parse a JSON feed
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question