Solved

MSFlexGrid - how can I format grid lines?

Posted on 2008-10-27
4
1,000 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
[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
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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

628 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