Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > General > MSFlexGrid picture


Reply
 
Thread Tools Display Modes
  #1  
Old 12-07-2002, 06:03 AM
Micheltje
Guest
 
Posts: n/a
Default MSFlexGrid picture


I've read this text on one of the topics:

Quote:
Remarks

You can put text, a picture, or both, in any cell of an MSFlexGrid. The Row and Col properties specify the current cell in an MSFlexGrid. You can specify the current cell in code, or the user can change it at run time using the mouse or the arrow keys. The Text property references the contents of the current cell.
and my question is , i've try'd to add pictures to a cell (0,1) but it didn't work, the only thing i saw was an error , can someone help me?
Reply With Quote
  #2  
Old 12-07-2002, 06:15 AM
Flyguy's Avatar
Flyguy Flyguy is offline
Lost Soul

Super Moderator
* Guru *
 
Join Date: May 2001
Location: Vorlon
Posts: 19,057
Default

Can you show us your code and tell us the error number/description you get.
Reply With Quote
  #3  
Old 12-07-2002, 06:27 AM
Micheltje
Guest
 
Posts: n/a
Default

When i've posted this topic my friend came online and i asked him if he knew the answer... this is what he said:

Code:
Set MSFlexgrid.CellPicture = imgImages.ListImages(1).Picture Dim img As ListImage Set img = imgImages.ListImages.Add(1, "Ticked", LoadPicture(App.Path & "\TickedBox.Bmp")) Set img = imgImages.ListImages.Add(2, "Crossed", LoadPicture(App.Path & "\Crossed.Bmp")) Set MSFlexgrid.CellPicture = imgImages.ListImages(1).Picture



But it didn't work either. my first code wasn't very diffucult .. but i try'd MsFlexGrid1.CellPicture (0,1) = app.Path & "Plaatjes/icon.ico"
Reply With Quote
  #4  
Old 12-07-2002, 06:37 AM
Flyguy's Avatar
Flyguy Flyguy is offline
Lost Soul

Super Moderator
* Guru *
 
Join Date: May 2001
Location: Vorlon
Posts: 19,057
Default

Indeed, the CellPicture method works only on the current cell (.Row, .Col), it doesn't accept parameters.
Reply With Quote
  #5  
Old 12-07-2002, 06:46 AM
Micheltje
Guest
 
Posts: n/a
Default

Do you know how i can let it work?
Reply With Quote
  #6  
Old 12-07-2002, 07:49 AM
Flyguy's Avatar
Flyguy Flyguy is offline
Lost Soul

Super Moderator
* Guru *
 
Join Date: May 2001
Location: Vorlon
Posts: 19,057
Default

Straight from the help:
Quote:
Code:
Private Sub Form_Click () ' Load the icons. MSHFlexGrid1.Row =1 MSHFlexGrid1.Col =1 Set MSHFlexGrid1.CellPicture =_ LoadPicture("Icons\Computer\Trash02a.ico") MSHFlexGrid1.Row =1 MSHFlexGrid1.Col =2 Set MSHFlexGrid1.CellPicture =_ LoadPicture("Icons\Computer\Trash02b.ico") End Sub
Reply With Quote
  #7  
Old 12-07-2002, 08:14 AM
Micheltje
Guest
 
Posts: n/a
Default

Code:
If query!Type = "uitgaven" Then MSFlexGrid1.Row = 1 MSFlexGrid1.Cols = 1 Set MSFlexGrid1.CellPicture = LoadPicture(App.Path & "\Plaatjes\APPSStop.ico") End If

This is the code what i currently have. But it doesn'y work either.. i get this error:
<Invalid Column Value>
Reply With Quote
  #8  
Old 12-08-2002, 03:33 AM
Flyguy's Avatar
Flyguy Flyguy is offline
Lost Soul

Super Moderator
* Guru *
 
Join Date: May 2001
Location: Vorlon
Posts: 19,057
Default

How many rows & columns does your flexgrid have?
Reply With Quote
  #9  
Old 12-08-2002, 04:59 AM
Anis's Avatar
Anis Anis is offline
| Coder XXX |

Retired Leader
 
Join Date: Jun 2001
Location: Kuala Lumpur, Malaysia.
Posts: 3,018
Default

Quote:
Originally posted by Micheltje
Code:
If query!Type = "uitgaven" Then MSFlexGrid1.Row = 1 MSFlexGrid1.Cols = 1 Set MSFlexGrid1.CellPicture = LoadPicture(App.Path & "\Plaatjes\APPSStop.ico") End If

This is the code what i currently have. But it doesn'y work either.. i get this error:
<Invalid Column Value>
Try this way.

Code:
If query!Type = "uitgaven" Then MSFlexGrid1.Row = 1 MSFlexGrid1.Col = 1 Set MSFlexGrid1.CellPicture = LoadPicture(App.Path & "\Plaatjes\APPSStop.ico") End If
__________________
Regards,
Muhammad Anis Ur Rehman

Miles to go Before I Sleep.

http://www.projekcarpet.com/anis.html
Reply With Quote
  #10  
Old 12-08-2002, 05:54 AM
Micheltje
Guest
 
Posts: n/a
Thumbs up

Thanks a lot .. it worked

Michel
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->