473,378 Members | 1,416 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Image in PropertyGrid

Hi
I ve got a class with some public properties and one of them is of type
image.

I use these properties in a propertygrid.
When the user press the little button into the propertygrid, an open file
dialog appears where he can choose the image he likes.

The question is How can I get the path of the image from the propertygrid or
the open dialog.

Thanks in advance
Nov 21 '05 #1
5 2980
There is no way to do that from the default implementation. The alternative
would be to implement your own UITypeEditor and apply that to your property.

-Atul, Sky Software http://www.ssware.com
Shell MegaPack For ActiveX & .Net - Windows Explorer Like Shell UI Controls

"Diomatas" <Di******@discussions.microsoft.com> wrote in message
news:53**********************************@microsof t.com...
Hi
I ve got a class with some public properties and one of them is of type
image.

I use these properties in a propertygrid.
When the user press the little button into the propertygrid, an open file
dialog appears where he can choose the image he likes.

The question is How can I get the path of the image from the propertygrid
or
the open dialog.

Thanks in advance

Nov 21 '05 #2
Hi Diomatas,

Why do you want the path of the image once the property is set if you have
the image? Notice that once the user has set the image in the property grid,
he could delete the file on disk and your app should work correctly. If the
path is the important thing, then the property should be named
ImageFileName, of String type.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com

"Diomatas" <Di******@discussions.microsoft.com> escribió en el mensaje
news:53**********************************@microsof t.com...
Hi
I ve got a class with some public properties and one of them is of type
image.

I use these properties in a propertygrid.
When the user press the little button into the propertygrid, an open file
dialog appears where he can choose the image he likes.

The question is How can I get the path of the image from the propertygrid
or
the open dialog.

Thanks in advance

Nov 21 '05 #3
The important thing is the path because I want to store it on a Database.. I
declared it as Image in order to give the user the oportunity to find the
file using the open dialog control.

"Carlos J. Quintero [VB MVP]" wrote:
Hi Diomatas,

Why do you want the path of the image once the property is set if you have
the image? Notice that once the user has set the image in the property grid,
he could delete the file on disk and your app should work correctly. If the
path is the important thing, then the property should be named
ImageFileName, of String type.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com

"Diomatas" <Di******@discussions.microsoft.com> escribió en el mensaje
news:53**********************************@microsof t.com...
Hi
I ve got a class with some public properties and one of them is of type
image.

I use these properties in a propertygrid.
When the user press the little button into the propertygrid, an open file
dialog appears where he can choose the image he likes.

The question is How can I get the path of the image from the propertygrid
or
the open dialog.

Thanks in advance


Nov 21 '05 #4
Then you have to declare the property as String and provide a button to
navigate to a file. This is done through a UITypeEditors, etc. See:

Building Windows Forms Controls and Components with Rich Design-Time
Features, Part 2
http://msdn.microsoft.com/msdnmag/is...-TimeControls/
--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
"Diomatas" <Di******@discussions.microsoft.com> escribió en el mensaje
news:00**********************************@microsof t.com...
The important thing is the path because I want to store it on a Database..
I
declared it as Image in order to give the user the oportunity to find the
file using the open dialog control.

"Carlos J. Quintero [VB MVP]" wrote:


Nov 21 '05 #5
Thanks mate...

"Carlos J. Quintero [VB MVP]" wrote:
Then you have to declare the property as String and provide a button to
navigate to a file. This is done through a UITypeEditors, etc. See:

Building Windows Forms Controls and Components with Rich Design-Time
Features, Part 2
http://msdn.microsoft.com/msdnmag/is...-TimeControls/
--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com
"Diomatas" <Di******@discussions.microsoft.com> escribió en el mensaje
news:00**********************************@microsof t.com...
The important thing is the path because I want to store it on a Database..
I
declared it as Image in order to give the user the oportunity to find the
file using the open dialog control.

"Carlos J. Quintero [VB MVP]" wrote:


Nov 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Chris Dunaway | last post by:
I am using the PropertyGrid and I have set the SelectedObject property to an instance of my custom class. One of the properties of the custom class is a bitmap. The PropertyGrid lets me assign...
6
by: Terry | last post by:
I have a very basic program, but for some reason I can't get it to behave properly. What I want is a basic form with a TabControl that fills the entire form. The tab control should have 4 tabs...
0
by: Mevar81 | last post by:
Hi to all.I have a big problem.I have a propertygrid im my application to configure some control.I want to change runtime the image of a control and store the name of the file that holds the image...
1
by: ANDRES BECERRA | last post by:
Herfried K. Wagner was kind enough to point me to the PropertyGrid control http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemwindowsformspropertygridclasstopic.asp I have found a few...
7
by: siddhiash | last post by:
Hi Friends I want to add PasswordChar Property which shows ****** for string which I type in PropertyGrid Control. Regards, Siddharth
6
by: Steve Teeples | last post by:
Can someone show me an example of how to place a "CheckedListBox" property within a PropertyGrid? -- ----------- Thanks, Steve
4
by: phcmi | last post by:
I have a PropertyGrid question. My task is to replace a legacy dialog box presentation with a modern one. The dialog itself allows the user to set configuration settings in our application, so...
3
by: =?Utf-8?B?U3RldmVU?= | last post by:
Is it possible to hide a row within a PropertyGrid based upon the boolean value of another row within the PropertyGrid? I am using VS2005 with .NET Frameworks 2.0. -- ----------- Thanks,...
2
by: Robbe Morris - [MVP] C# | last post by:
I've never had to do this before... I have a web app that needs to look for image files outside the web site folders if it is run on localhost but look for the image files in sub folders of the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.