[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

VB6 - Highlight single MSHFlexgrid cell when selecting

Posted on 2013-01-27
3
Medium Priority
?
1,307 Views
Last Modified: 2013-01-27
Hello all

I would like to know if it is possible to highlight single MSHFlexgrid1 cell when i select on and if a change cell, it will put back to regular color the previous one and highlight new cell selected?

How can i do that?

Thanks again for your help
0
Comment
Question by:Wilder1626
[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
3 Comments
 
LVL 49

Accepted Solution

by:
Martin Liss earned 2000 total points
ID: 38825159
You can do it through code. This highlights in yellow. Choose any color you wish.


Private Sub MSHFlexGrid1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)

Dim lngRow As Long
Dim lngCol As Long
Dim intSaveRow As Integer
Dim intSaveCol As Integer

With MSHFlexGrid1
    intSaveRow = .Row
    intSaveCol = .Col

    For lngRow = 1 To .Rows
        For lngCol = 1 To .Cols
            .FillStyle = flexFillSingle
            .Row = lngRow - 1
            .Col = lngCol - 1
            .CellBackColor = vbWhite
        Next
    Next
    
    .Row = intSaveRow
    .Col = intSaveCol
    .CellBackColor = vbYellow
End With
End Sub

Open in new window

0
 
LVL 11

Author Closing Comment

by:Wilder1626
ID: 38825258
Hi again

This is again perfect

Thanks
0
 
LVL 49

Expert Comment

by:Martin Liss
ID: 38825283
You're welcome again and I'm glad I was able to help.

Select the 'About Me' tab in my profile and you'll find links to some articles I've written that may interest you.
Marty - MVP 2009 to 2012
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

656 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