Solved

MSFlexGrid - how can I format grid lines?

Posted on 2008-10-27
4
978 Views
Last Modified: 2013-11-28
I am developing an application and am using a flexgrid control to display data.  This is not bound to data but is being loaded and modified in code.

What I really need is to control how the grid lines apparently look, for example I'd like a thicker horizontal line between each two rows.

I know that the grid lines in the control do not offer this functionality and I've tried simulating the effect by using either a line control or a picture box control and positioning it on top of the grid in the appropriate place.

Unfortunately, it would appear that the grid always appears on top of everything else and so these controls cannot be seen!

How can I take control of the way specific grid lines appear?

What I've done so far is to have some extra rows of small height and with the required background colour but it's hardly satisfactory and requires quite a lot of extra programming to ensure that the mouse clicking on, or the cursor keys moving into, these 'fake' cells are handled.
0
Comment
Question by:trentham
  • 2
  • 2
4 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22819590
trentham,

Are you even sure this is even possible?

Why not just alternate the row color?
http://www.experts-exchange.com/Programming/Languages/Visual_Basic/Q_10207284.html

JeffCoachman
0
 

Author Comment

by:trentham
ID: 22819992
I'm NOT sure that this is possible which is why I've posted the question to a wider audience!

Someone may have a definitive answer as to whether another control can be seen ON TOP of one of these grids.  There are suggestions that VB6 can do this but none of those approaches have worked with VBA in MSAccess.  For example, an approach that is used to make a cell apparently editable is to overlay an edit control on it ... but in this app, it always seems to get hidden by the grid!

Unfortunately the more obvious approach of alternating row colour is not ideal.  The colours of rows indicates various other things.  This is a booking calendar and the two connected rows indicate daytime and evening for each room.  The background colour is used to indicate whether it is; normally available, not available, already booked, etc, etc. - although I've not ruled this approach out entirely!

0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 22822568
OK,

Good luck with this!
;-)
0
 

Accepted Solution

by:
trentham earned 0 total points
ID: 22874719
OK, it seems that what I want is probably not possible so the following is an outline of my workaround.

In order to apply apparent horizontal grid lines of a different colour I inserted extra rows, one per gridline, and set them to have a low heigh valuet.  Providing the background colour of that row then gave me the visual effect I was after.  I refer to these cells as 'gridline cells'.

However this causes a number of inconveniences and there are things to handle:-

1. It's a bit more awkward now because if I want row 7, say, there may be grid lines to add in to fnd out that it is really row 10 now!  There are lots of ways to handle this, including a simple mapping function.

2. In my grid, the user can click on a cell.  It is just as possible for them to click on one of these gridline cells and then the cursor appears to vanish!  I recognise this and also keep track of what cell they were in last.  When they click on such a gridline cell they are repositioned to either the one above or the one below where they clicked, depending on where they were last.

3. In my grid the user can move around wth the cursor keys.  It's a simple matter when up or down cursor is used and a gridline cell is landed on to 'bump' the focus into the next cell.

It's not a tidy solution but it gives me what I want!
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Programmer 14 49
object variable or with block not set 6 30
Access Open Report with SQL Parameter 11 30
Opening forms with an input box 5 22
Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

810 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