Thread: caption of mainwindows changes while exporting registry data

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

    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
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675
    This line:
    Code:
     this.Text = iniFile.FileName;
    looks like the culprit.

  3. #3
    Registered User
    Join Date
    Nov 2008
    Posts
    222
    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, 05:49 PM
  2. singly linked circular list
    By DarkDot in forum C++ Programming
    Replies: 0
    Last Post: 04-24-2007, 08:55 PM
  3. Errors
    By Rhidian in forum C Programming
    Replies: 10
    Last Post: 04-04-2005, 12: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, 01:31 PM