Solved

Visual Basic 6 modify datagrid coloumn properties

Posted on 2003-11-19
7
2,633 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
A short article about a problem I had getting the GPS LocationListener working.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

910 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now