Click here to Skip to main content
15,914,419 members
Home / Discussions / C#
   

C#

 
AnswerRe: decimal.ToString() mystery Pin
Luc Pattyn28-Feb-11 12:41
sitebuilderLuc Pattyn28-Feb-11 12:41 
GeneralRe: decimal.ToString() mystery Pin
V.28-Feb-11 20:35
professionalV.28-Feb-11 20:35 
AnswerRe: decimal.ToString() mystery Pin
Eddy Vluggen28-Feb-11 11:42
professionalEddy Vluggen28-Feb-11 11:42 
GeneralRe: decimal.ToString() mystery Pin
Super Lloyd28-Feb-11 11:50
Super Lloyd28-Feb-11 11:50 
GeneralRe: decimal.ToString() mystery Pin
Eddy Vluggen28-Feb-11 20:47
professionalEddy Vluggen28-Feb-11 20:47 
GeneralRe: decimal.ToString() mystery Pin
Super Lloyd28-Feb-11 21:11
Super Lloyd28-Feb-11 21:11 
GeneralRe: decimal.ToString() mystery Pin
Eddy Vluggen28-Feb-11 21:19
professionalEddy Vluggen28-Feb-11 21:19 
AnswerRe: decimal.ToString() mystery [SOLVED] Pin
RobCroll28-Feb-11 16:11
RobCroll28-Feb-11 16:11 
GeneralRe: decimal.ToString() mystery [SOLVED] Pin
Super Lloyd28-Feb-11 16:21
Super Lloyd28-Feb-11 16:21 
Questionmy program works very slow Pin
Erdinc2728-Feb-11 8:04
Erdinc2728-Feb-11 8:04 
AnswerRe: my program works very slow Pin
Luc Pattyn28-Feb-11 8:55
sitebuilderLuc Pattyn28-Feb-11 8:55 
AnswerRe: my program works very slow Pin
RobCroll28-Feb-11 12:16
RobCroll28-Feb-11 12:16 
AnswerRe: my program works very slow Pin
PIEBALDconsult28-Feb-11 13:19
mvePIEBALDconsult28-Feb-11 13:19 
GeneralRe: my program works very slow Pin
Erdinc273-Mar-11 5:09
Erdinc273-Mar-11 5:09 
Questionhow to programing Microsoft Management Console ?? Pin
GREG_DORIANcod28-Feb-11 4:58
professionalGREG_DORIANcod28-Feb-11 4:58 
AnswerRe: how to programing Microsoft Management Console ?? Pin
Eddy Vluggen28-Feb-11 6:02
professionalEddy Vluggen28-Feb-11 6:02 
AnswerRe: how to programing Microsoft Management Console ?? Pin
RaviRanjanKr28-Feb-11 17:09
professionalRaviRanjanKr28-Feb-11 17:09 
Questionaccessing folder from project Pin
jashimu28-Feb-11 4:37
jashimu28-Feb-11 4:37 
AnswerRe: accessing folder from project Pin
OriginalGriff28-Feb-11 5:30
mveOriginalGriff28-Feb-11 5:30 
GeneralRe: accessing folder from project Pin
jashimu28-Feb-11 7:03
jashimu28-Feb-11 7:03 
GeneralRe: accessing folder from project Pin
Tony Richards28-Feb-11 7:51
Tony Richards28-Feb-11 7:51 
GeneralRe: accessing folder from project [modified] Pin
OriginalGriff28-Feb-11 8:41
mveOriginalGriff28-Feb-11 8:41 
Take note of what Tony says, but also be aware that the new Bitmap(path) constructor does exactly the same thing as the Image.FromFile(path) method: It locks the file until the Bitmap is disposed. MSDN[^]

What that means is that is you do:
PictureBox.Image = New Bitmap("myImage")
PictureBox.Image = New Bitmap("myOtherImage")
PictureBox.Image = New Bitmap("myImage")
You will get an exception because the file "myImage" is in use for the third bitmap.

That doesn't mean you can change images in a button click event: the file remains locked until the Bitmap is Disposed. I.e. when the Garbage collector finally gets called in, and decides it is no longer needed. That could be now, could be next week. Use the Stream method instead: it does not have that problem.


[edit]Luc kindly pointed out that it is a read lock, so only write, rename, and delete operations will be affected. So if you are just displaying the image and not changing the file, it won't be a problem.[/edit]
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.

Digital man: "You are, in short, an idiot with the IQ of an ant and the intellectual capacity of a hose pipe."

modified on Monday, February 28, 2011 3:27 PM

GeneralRe: accessing folder from project Pin
Luc Pattyn28-Feb-11 9:04
sitebuilderLuc Pattyn28-Feb-11 9:04 
GeneralRe: accessing folder from project Pin
OriginalGriff28-Feb-11 9:26
mveOriginalGriff28-Feb-11 9:26 
AnswerRe: accessing folder from project Pin
Luc Pattyn28-Feb-11 9:34
sitebuilderLuc Pattyn28-Feb-11 9:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.