Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Visual Basic 6 modify datagrid coloumn properties

Posted on 2003-11-19
7
Medium Priority
?
2,651 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 1000 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 1000 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

The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

Question has a verified solution.

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

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Starting up a Project

670 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