|
-
May 31st, 2000, 09:19 AM
#1
Thread Starter
Member
Does MSFlexGrid have a property or method so that I can
set different color for one cell and another color for another cell? Please help! Thank you...
-
May 31st, 2000, 09:32 AM
#2
PowerPoster
you can use the MSHFlexGrid1.CellBackColor properties to do it.
-
May 31st, 2000, 09:36 AM
#3
Thread Starter
Member
For some reason I only have one cell colored. You have any
code? Thank you...
-
Aug 14th, 2000, 09:15 PM
#4
Lively Member
Originally posted by laura
Does MSFlexGrid have a property or method so that I can
set different color for one cell and another color for another cell? Please help! Thank you...
Hi there,
How can I save the back ground color of the cells and rows, even after I close the form?
That is, I want to retain the back color of the cells and rows
Is it possible? If so, pls tell me how?
Thanks in advance.
Rathi
-
Aug 15th, 2000, 07:53 AM
#5
New Member
Hi there.
I'm using public constants to 'remember' the background colors for the active cell and the last activated cell
Public Const CellLastColor as Variant ' Can't remember the right datatype
Public const CellDefaultColor = &HFFFFFF ' plain white
Public Const CellActiveColor = &H800000 ' vbBlue
Public Const CellNoteColor = &HEAD5FF ' shady pink ;-)
Since I have notes attached to some of the cells in the MSFlexgrid, I only needed to specify the note color and keep information in a list containing the row and coloumn where notes are attached.
Do you have specific colors for each cell that you need to save?
If you want all of your cells to have (except fixed cells)
the nice blue color use:
dim i as integer, j as integer
dim intFirstRow as integer, intFirstCol as integer
' non-fixed that is
dim intMaxRow as integer, intMaxCol as integer
intFirstRow = 1
intFirstCol = 1
intMaxRow = MSFlexgrid1.rows - 1
intMaxCol = MSFlexGrid1.cols - 1
for i = intFirstCol to intMaxCol
MSFlexGrid1.col = i
For j = intFirstRow to intMaxRow
MSFlexGrid1.row = j
' Insert update of your list if you want
' to save the previous Cell color
MSFlexGrid1.CellBackColor = CellActiveColor
' or MSFlexGrid1.CellBackColor = vbBlue
next j
next i
There you go
Regards Kishpa
-
Aug 15th, 2000, 10:55 AM
#6
Lively Member
MSH FlexGrid color
Originally posted by Iluvaras
Hi there.
I'm using public constants to 'remember' the background colors for the active cell and the last activated cell
Public Const CellLastColor as Variant ' Can't remember the right datatype
Public const CellDefaultColor = &HFFFFFF ' plain white
Public Const CellActiveColor = &H800000 ' vbBlue
Public Const CellNoteColor = &HEAD5FF ' shady pink ;-)
Since I have notes attached to some of the cells in the MSFlexgrid, I only needed to specify the note color and keep information in a list containing the row and coloumn where notes are attached.
Do you have specific colors for each cell that you need to save?
If you want all of your cells to have (except fixed cells)
the nice blue color use:
dim i as integer, j as integer
dim intFirstRow as integer, intFirstCol as integer
' non-fixed that is
dim intMaxRow as integer, intMaxCol as integer
intFirstRow = 1
intFirstCol = 1
intMaxRow = MSFlexgrid1.rows - 1
intMaxCol = MSFlexGrid1.cols - 1
for i = intFirstCol to intMaxCol
MSFlexGrid1.col = i
For j = intFirstRow to intMaxRow
MSFlexGrid1.row = j
' Insert update of your list if you want
' to save the previous Cell color
MSFlexGrid1.CellBackColor = CellActiveColor
' or MSFlexGrid1.CellBackColor = vbBlue
next j
next i
There you go
Regards Kishpa
Hi there,
Thank you very much for your support.
I could have been more specific about my question.
My form has MSHFlexgrid control and a Common dialog color control. I can color cells and rows using the dialog
control.
when I close the form, all the color settings are gone. How
can I retain this?
Your help would be greatly appreciated.
thanks
sincerely,
Rathi
-
Aug 15th, 2000, 11:47 AM
#7
Lively Member
Use the SaveSetting and GetSetting functions to save and retrieve the colors from the registry.
Look up the functions in MSDN for examples.
-
Aug 16th, 2000, 07:19 AM
#8
Lively Member
MSH flex grid coloring cells
Originally posted by ttingen
Use the SaveSetting and GetSetting functions to save and retrieve the colors from the registry.
Look up the functions in MSDN for examples.
Hi there,
Thanks a lot for your time.
The savesetting function has four arguments. I tried to understand the parameters: Section, Key, and Setting for the whole day, but no use. Examples in MSDN did not help me.
How can I use this function, to save the color of the cells?
Your help would be greatly appreciated.
Thank you.
sincerely,
Rathi
-
Aug 16th, 2000, 09:12 AM
#9
Lively Member
Re: MSH flex grid coloring cells
Originally posted by rathi
Originally posted by ttingen
Use the SaveSetting and GetSetting functions to save and retrieve the colors from the registry.
Look up the functions in MSDN for examples.
Hi there,
Thanks a lot for your time.
There are many cells through out the grid with different colors. Is it possible to save the color settings of all the cells using the savesetting and getsetting function ?
Your help would be greatly appreciated.
Thank you.
sincerely,
Rathi
-
Aug 16th, 2000, 09:21 AM
#10
Lively Member
Here's a tutorial on how to use the functions:
http://www.vb-world.net/articles/registry1/
If you click on registry on the left-hand menu you will see a couple of other tutorials that use the registry to persist user settings, etc...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|