|
Look at the RemovePreviousVersions flag in msi properties: here[^] a guide.
|
|
|
|
|
|
I am still facing a problem of Tab Form.
I have Tab form of two pages i want to blink cursor / focus of cursor in first text box of first page of tab form.
(Cursor should blink user can use it on load form)
I try some code but not archive target and trying still beside other tasks.
Tell me what should i do for ........
|
|
|
|
|
have you tried setting the focus of the control you want in the load event of the form?
or simply set you tab indexes correctly and it should automatically be the first control that gets focus
Life goes very fast. Tomorrow, today is already yesterday.
|
|
|
|
|
-> You can easily set the TabIndex property of Textbox to 0 for focusing.
-> At Form OnLoad event, set textbox.focus().
|
|
|
|
|
I am asking about Tab for not for only the text box on simple form.
|
|
|
|
|
tabControl1.SelectedIndex = 0;
textBox.Focus();
|
|
|
|
|
Hi All,
I have a question that I can't answer, I hope you guys will help me =)
I have a program in which user selects a source directory and a target directory and the files in the source directory are processed and copied into the target directory. All is fine until this:
I created directories manually (for test purposes), I mean not inside the code but Right Click-->New-->New Folder =)
When the process is done, files are OK. This means they can be deleted, moved, renamed. But the directories stay locked. I cannot rename, move, delete the directories.
So, why does this happen and how can I correct it?
Thanks
Edit: Oh, by the way I forgot to mention I used DirectoryInfo and FileInfo.
|
|
|
|
|
If you want the solution, post the code for your project here.
|
|
|
|
|
Well, I guess you're right. My bad, my bad.
DirectoryInfo dir = new DirectoryInfo(srcDirectory);
foreach (FileInfo fil in dir.GetFiles("*.jpg"))
{
imagesJPEG.Add(Bitmap.FromFile(fil.FullName));
fileNames.Add(fil.Name);
imageCount++;
}
foreach (FileInfo fil in dir.GetFiles("*.tiff"))
{
imagesTIFF.Add(Bitmap.FromFile(fil.FullName));
fileNames.Add(fil.Name);
imageCount++;
}
foreach (FileInfo fil in dir.GetFiles("*.png"))
{
imagesPNG.Add(Bitmap.FromFile(fil.FullName));
fileNames.Add(fil.Name);
imageCount++;
}
This is the only code which has direct access to directories. All other functions just use a string for the destination folder and doesn't have anything to do with folders =)
|
|
|
|
|
If you are working with images, don't forget to dispose them. Otherwise they will stay locked.
|
|
|
|
|
Thanks for the reply
They are disposed right after they are processed but I will take a look at that just to make sure.
But, as I said, files which are copied into the target directory are not locked. Only the target directory stays locked.
|
|
|
|
|
Hi,
use Image.FromStream() instead of Image.FromFile(); that way they don't get locked at all.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
So, you say this can keep only the folder locked, while the files created are not.
I'll give it a try and let you know.
Thanks =)
|
|
|
|
|
MNantu wrote: So, you say this can keep only the folder locked
I didn't say a thing about folders.
However when a file is locked, so is the entire path to it.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Well, actually that's the point which confuses me. =)
Files are ok. They can be deleted, renamed, moved, whatever you want. But only the folder is not. You cannot do these to the folder and when you try you face that "File's in use" kinda error =)
But as I said just the folder not the entire path.
Maybe I'm a sinner and God is punishing me this way
Seriously, I wonder what I'm doing wrong.
|
|
|
|
|
Hi,
if your folder is locked when your app runs,, and not when it doesn't run, then there is something wrong in your app.
if your folder is locked all the time, then either some other program is locking it (try closing every app), or it got a read-only flag set.
if you need help, provide very specific symptoms.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
I guess you're right about the details I've provided, my mistake
And the folder is locked all the time after I've created it (manually created by the way, not created by the application).
Anyways I'll have to figure out a solution no matter what.
So thanks for the effort, everyone
|
|
|
|
|
Bitmap.FromFile() sucks, it keep lock the file until you dispose that Bitmap instance. Use Bitmap.FromStream() instead.
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
-----------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Hi guys,
I've written a simple C# console application is VS.NET 2005 and now I want that as soon as the user clicks on the exe file, the location of the exe file, no matter wherever it is, is shifted to 'D:/Folder/'. It is noteworthy, that I dont want replication, just replacement of the original exe file from its source location, to that location programmed. Therefore, can anyone help me with that little piece of code, using which I can replace my console app. from its current location to another location programatically allocated on the system?
Your help will be appreciated,
Rajdeep.NET
|
|
|
|
|
|
thanx! U see, nobody helps me in CodeProject! I dont know why. They say I post wrong answers! But thats no problem. I give right answers or wrong or whatever, but atleast, I am answering.
|
|
|
|
|
Oh, come on!
I think you need a hug
Happy to help you out.
|
|
|
|
|
In which type of application, you can use such type of implementation?
|
|
|
|
|
Hello Rajdeep,
It is possible.You should copy your exe to another location and then pass the aregument to that exe to delete first.
mailto: anubhava.prodata@gmail.com
|
|
|
|