Tuesday, January 10, 2012

WPF Popup Window

Hi,

     we can use a WPF Popup window using show dialogBox. Hope code will be clear to you.

  // Main window any event  
  private void LoadListOfEmployee()  
     {  
             // Pop Up window open  
       PopUpEmployeeInfoList objPopupEmployeeList = new PopUpEmployeeInfoList();  
       if (objPopupEmployeeList.ShowDialog() == true)  
       {  
                  EEmployeeInfo eEmoloyeeInfoObj = new EEmployeeInfo();  
                  // Casting Popup window data   
         eEmoloyeeInfoObj = objPopupEmployeeList.employesLstView.SelectedItem as EEmployeeInfo;  
                     // Setting popupwindow data to main window control  
         textEmployeeCode.Text = eEmoloyeeInfoObj.EmployeeCode;  
         tenureEmployeeCodeTextBox.Text = eEmoloyeeInfoObj.EmployeeCode;  
         releaseEmployeeCodeTextBox.Text = eEmoloyeeInfoObj.EmployeeCode;  
       }  
     }  

 // Pop Up window Event  
           // using this.DialogResult = true; popup window replace the control to main window  
            private void employesLstView_KeyDown(object sender, KeyEventArgs e)  
     {  
       if (employesLstView.SelectedIndex > -1)  
       {  
         if (e.Key == Key.Enter)  
         {  
           this.DialogResult = true;  
         }  
       }  
     }  

SQL Get all Index create script from Database

To get all script from database as a create new index into another database you can use the following --Get all Index Script SELECT...