Solved

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

Posted on 2000-03-15
2
492 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
[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 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

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…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…

724 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