Solved

Visual Basic 6 modify datagrid coloumn properties

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
MaxSpan challenge 9 68
bunnyEars challenge 6 67
allStar challenge 1 43
Please explain: Aspect Oriented Programming 2 57
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

744 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

11 Experts available now in Live!

Get 1:1 Help Now