Click here to Skip to main content
15,903,175 members
Home / Discussions / C#
   

C#

 
QuestionFinding base class of an object Pin
dashingsidds4-Jun-10 3:07
dashingsidds4-Jun-10 3:07 
AnswerRe: Finding base class of an object Pin
JoeSharp4-Jun-10 3:27
JoeSharp4-Jun-10 3:27 
AnswerRe: Finding base class of an object Pin
Anthony Mushrow4-Jun-10 3:45
professionalAnthony Mushrow4-Jun-10 3:45 
GeneralRe: Finding base class of an object Pin
dashingsidds4-Jun-10 4:25
dashingsidds4-Jun-10 4:25 
AnswerRe: Finding base class of an object Pin
#realJSOP4-Jun-10 4:52
professional#realJSOP4-Jun-10 4:52 
QuestionIssue with Environment.SpecialFolder.MyDocuments Pin
False Chicken4-Jun-10 2:09
False Chicken4-Jun-10 2:09 
AnswerRe: Issue with Environment.SpecialFolder.MyDocuments Pin
Johnny J.4-Jun-10 2:16
professionalJohnny J.4-Jun-10 2:16 
GeneralRe: Issue with Environment.SpecialFolder.MyDocuments Pin
False Chicken4-Jun-10 2:22
False Chicken4-Jun-10 2:22 
GeneralRe: Issue with Environment.SpecialFolder.MyDocuments Pin
Johnny J.4-Jun-10 2:23
professionalJohnny J.4-Jun-10 2:23 
Questioncolor get changed in another pc Pin
eraser9504-Jun-10 2:03
eraser9504-Jun-10 2:03 
AnswerRe: color get changed in another pc Pin
OriginalGriff4-Jun-10 2:26
mveOriginalGriff4-Jun-10 2:26 
AnswerRe: color get changed in another pc Pin
Hristo-Bojilov4-Jun-10 2:27
Hristo-Bojilov4-Jun-10 2:27 
QuestionConvert System.Drawing.Image to System.Web.UI.WebControls.Image Pin
Add44-Jun-10 0:55
Add44-Jun-10 0:55 
AnswerRe: Convert System.Drawing.Image to System.Web.UI.WebControls.Image Pin
Hristo-Bojilov4-Jun-10 1:55
Hristo-Bojilov4-Jun-10 1:55 
QuestionHow to control a outer application? [modified] Pin
imbiz3-Jun-10 23:46
imbiz3-Jun-10 23:46 
AnswerRe: How to control a outer application? Pin
Luc Pattyn4-Jun-10 0:38
sitebuilderLuc Pattyn4-Jun-10 0:38 
GeneralRe: How to control a outer application? Pin
imbiz4-Jun-10 2:20
imbiz4-Jun-10 2:20 
GeneralRe: How to control a outer application? Pin
Luc Pattyn4-Jun-10 7:18
sitebuilderLuc Pattyn4-Jun-10 7:18 
GeneralRe: How to control a outer application? [modified] Pin
imbiz4-Jun-10 21:39
imbiz4-Jun-10 21:39 
Questionlistbox Pin
kennyhibs3-Jun-10 22:30
kennyhibs3-Jun-10 22:30 
AnswerRe: listbox Pin
Peace ON3-Jun-10 23:34
Peace ON3-Jun-10 23:34 
GeneralRe: listbox Pin
kennyhibs4-Jun-10 21:39
kennyhibs4-Jun-10 21:39 
Thanks for reply, i've removed second list box as i dont think it has any use for what i want it to do.
i now use the textbox to change name of listbox1 selecteditem and i am now trying to rename the actual file with "file.move" but i'm having a problem with second part of "file.move"

private void fileSystemWatcher1_Created(object sender, System.IO.FileSystemEventArgs e)
   {
       listBox1.Items.Add(e.FullPath);
       listBox1.SelectedIndex = listBox1.Items.Count - 1;
       listBox1.SelectedIndex = -1;
               }

   private void listBox1_Click(object sender, EventArgs e)
   {

       int itemSelected = this.listBox1.SelectedIndex;
       string itemText = this.listBox1.Items[itemSelected].ToString();

       Rectangle r = this.listBox1.GetItemRectangle(itemSelected);
       this.textBox1.Location = new System.Drawing.Point(r.X + 217, r.Y + 520);
       this.textBox1.Size = new System.Drawing.Size(r.Width + 4, r.Height - 10);
       this.textBox1.Visible = true;
       this.textBox1.Text = itemText;
       this.textBox1.Focus();
       this.textBox1.SelectAll();

   }


   private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
   {


       if (e.KeyChar == 13)

       {
           File.Move(Path.GetFullPath(listBox1.SelectedItem.ToString()), this.textBox1.Text.ToString()+".avi" );
           this.listBox1.Items[this.listBox1.SelectedIndex] = this.textBox1.Text;

           this.textBox1.Visible = false;



       }
       if (e.KeyChar == 27)
           this.textBox1.Visible = false;



It renames the file ok but moves file to debug directory of my project instead of leaving it where it is and just renaming it


kenny
Questionwant to change theme of controls..... Pin
jainiraj3-Jun-10 19:54
jainiraj3-Jun-10 19:54 
AnswerRe: want to change theme of controls..... Pin
Johnny J.3-Jun-10 21:16
professionalJohnny J.3-Jun-10 21:16 
AnswerRe: want to change theme of controls..... Pin
Abhinav S3-Jun-10 21:31
Abhinav S3-Jun-10 21:31 

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.