By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,290 Members | 1,303 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,290 IT Pros & Developers. It's quick & easy.

Are associated file loactions dynamic?

P: n/a
I am having a problem!

I am using the Task Pane control which MS gave out in their VBPowerPack.

If I add an image to the task frame I have to use a physical path e.g.
c:\connected.bmp as opposed to a more dynamic path such as
System.Environment.CurrentDirectory & "\Images\Connected.bmp".

With a picture box for example I would generally leave it blank and then add
the image at runtime using something like :

image.fromfile(System.Environment.CurrentDirectory & "\Images\Connected.bmp")

thereby allowing the user to have control as to where they can save the
application as the image path is dynamic and the image directory added by the
installer.

I tried editing the VS designer generated code to use a path like the one
above and it works at runtime but I lose the design time view of the image.
It also causes the task frames to render the wrong size being slightly too
short.

Does anyone have any ideas (or better controls) which would help.

P.S. I hope some of that made some sense!
--
If at first you don't succeed... Hide the evidence that you tried!
Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Director - Minvent" <Di*************@discussions.microsoft.com> schrieb:>
If I add an image to the task frame I have to use a physical path e.g.
c:\connected.bmp as opposed to a more dynamic path
such as System.Environment.CurrentDirectory & "\Images\Connected.bmp".
Always use 'System.IO.Path.Combine' to combine two paths!
With a picture box for example I would generally leave it
blank and then add the image at runtime using something
like :

image.fromfile(System.Environment.CurrentDirectory &
"\Images\Connected.bmp")

thereby allowing the user to have control as to where they can
save the application as the image path is dynamic and the
image directory added by the installer.


Set the images in your form's constructor directly after the call to
'InitializeComponent'. You can check the form's 'DesignMode' property to
see if the form is in design mode.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.