Solved

Visual Basic 6 modify datagrid coloumn properties

Posted on 2003-11-19
7
2,647 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

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.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
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…

632 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