caption of mainwindows changes while exporting registry data

This is a discussion on caption of mainwindows changes while exporting registry data within the C# Programming forums, part of the General Programming Boards category; Hi all I have a serious bug in my design. The error shows that the caption of my main window ...

  1. #1
    Registered User
    Join Date
    Nov 2008
    Posts
    162

    Thumbs up caption of mainwindows changes while exporting registry data

    Hi all

    I have a serious bug in my design. The error shows that the caption of my main window changes after exporting the registry data; which i do not want to happen. Is there any way not to change the main window caption while exporting?

    Code:
       private void menuItemExport_Click(object sender, System.EventArgs e)
            {
                string fullPath = "";
                fullPath = this.tvFolders.SelectedNode.FullPath.ToString();
    
             
                //for opening the savefile option dialog box
                SaveFileDialog iniFile = new SaveFileDialog();
                iniFile.Title = "Export the registry file";
                iniFile.InitialDirectory = @"c:\";
                iniFile.Filter = "sbreg files (*.sbreg)|*.sbreg|All files (*.*)|*.*";
     
                iniFile.FilterIndex = 4;
                iniFile.RestoreDirectory = false;
                string fileName = "";
    
                //the file has to be saved after clicking the OK button
                if (iniFile.ShowDialog() == DialogResult.OK)
                {
                    this.Text = iniFile.FileName;
                    //fileName = iniFile.FileName.ToString();
                    
                    if (System.IO.File.Exists(iniFile.FileName))
                    {
                        System.IO.File.Delete(iniFile.FileName);
                    }
    Pls help me anyone.

    Thanks

  2. #2
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,655
    This line:
    Code:
     this.Text = iniFile.FileName;
    looks like the culprit.

  3. #3
    Registered User
    Join Date
    Nov 2008
    Posts
    162
    hi rags

    thanks for your reply...yes it was the culprit :-0

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. brace-enclosed error
    By jdc18 in forum C++ Programming
    Replies: 53
    Last Post: 05-03-2007, 06:49 PM
  2. singly linked circular list
    By DarkDot in forum C++ Programming
    Replies: 0
    Last Post: 04-24-2007, 09:55 PM
  3. Errors
    By Rhidian in forum C Programming
    Replies: 10
    Last Post: 04-04-2005, 01:22 PM
  4. Binary Tree, couple questions
    By scoobasean in forum C Programming
    Replies: 3
    Last Post: 03-12-2005, 09:09 PM
  5. How do I base size of arrays on annother number?
    By Dual-Catfish in forum C++ Programming
    Replies: 15
    Last Post: 09-25-2001, 02:31 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21