![]() |
propertyitempicture |
Post Reply ![]() |
Author | |
johnp ![]() Groupie ![]() ![]() Joined: 21 February 2008 Status: Offline Points: 49 |
![]() ![]() ![]() ![]() ![]() Posted: 16 April 2010 at 8:48am |
Hi,
I've added a picture type item to my property grid with an expand button to allow the user to select the desired image. Once the image is selected I see that a tiny preview image is shown on the grid item. Is there a built in method that I can use to allow the user to view a larger version of the preview or will I need to add my own inplace button and open the image in a separate window or picture control?
Thanks!
|
|
![]() |
|
Aaron ![]() Senior Member ![]() Joined: 29 January 2008 Status: Offline Points: 2192 |
![]() ![]() ![]() ![]() ![]() |
Hi,
You have to calculate the width & height of the image yourself and use Item.PreviewWidth & Item.Height to set the desired size.
If you would add the selected image to PropertyGridControl.Icons collection which knows the width & height already and use the GetImage method to get desired width & height and use these to size the PropertyGridItem... Something like this:
Private Sub wndPropertyGrid_ValueChanged(ByVal Item As XtremePropertyGrid.IPropertyGridItem)
If Item.Type = PropertyItemPicture Then Me.wndPropertyGrid.Icons.RemoveIcon 999 'Note: before adding image to .Icons you have to check if image is an Icon or a Bitmap
Me.wndPropertyGrid.Icons.AddIcon Item.Value, 999, xtpImageNormal 'Size PropertyGridItem Item.PreviewWidth = Me.wndPropertyGrid.Icons.GetImage(999, 0).Width
Item.Height = Me.wndPropertyGrid.Icons.GetImage(999, 0).Height End If End Sub
Hope this helps a little
![]() |
|
Product: Xtreme SuitePro (ActiveX) version 15.0.2
Platform: Windows XP (32bit) - SP 2 Language: Visual Basic 6.0 Zero replies is not an option.... |
|
![]() |
Post Reply ![]() |
|
Tweet
|
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |