Solved

How do I detect a picture in MSFlexGrid's CellPicture?

Posted on 2000-03-15
2
448 Views
Last Modified: 2012-05-04
How do I detect a picture in MSFlexGrid's CellPicture property. I have picture A and picture B that I put in a MSFlexgrid's cellpicture property. I would like to do :

if MSFlexgrid.CellPicture = Picture A ...

Can this be done?
0
Comment
Question by:mfarid1
2 Comments
 
LVL 32

Accepted Solution

by:
Erick37 earned 50 total points
ID: 2620112
The one unique value you can test is the CellPicture.Handle value. The handles will be the same for the picture object and the CellPicture.  Remember that the value of the handle will change each time a new picture is loaded.

Ex:

Option Explicit

Private picA As StdPicture

Private Sub Command1_Click()
    If (picA.Handle = MSFlexGrid1.CellPicture.Handle) Then
        'It's picA
        Debug.Print picA.Handle
    End If
End Sub

Private Sub Form_Load()
    Set picA = LoadPicture("c:\test.bmp")
    Set MSFlexGrid1.CellPicture = picA
End Sub
0
 

Author Comment

by:mfarid1
ID: 2629527
Thanks
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…

760 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

17 Experts available now in Live!

Get 1:1 Help Now