Forum  Core :: SDK (Vi...  Developing the ...  Close UserControl
Previous Previous
 
Next Next
New Post 4/15/2009 12:32 PM
  avalor
119 posts
5th Level Poster


Close UserControl 

Hi,

   Which is the best way to close the controlUser

  i have my principal form show below, when i click on the "clientes" item in the menu, i display the second form.

Code: private void menuItem2_Click(object sender, EventArgs e)
        {
            frmClientes obj = new frmClientes();
            pnlContenido.Controls.Add(obj);
        }

This is the second form, how can i dispose the second form and back to the principal form when i click on some button, i have use this.form.close() and close all the forms, another thing where do i send project sample  for support, thx


Report Post 
 
New Post 4/15/2009 4:52 PM
  palli
11189 posts
1st Level Poster




Re: Close UserControl 

Hi avalor,

Hmmm... I think a allready answered all those questions in this thread here.

As an addition to my reply there, then if you have a button in the child form where you call "this.Form.Close()" then what you are actually doing is you are closing the parent or owner form. As this is MDI, then all the child forms are closed as well.

With the simple change of that code to "this.Close();" you should have the desired effect, of just closing the child form.

Hope this helps.

Palli

 


Páll Björnsson - Visual WebGui support team - Email: support@visualwebgui.com
 
New Post 4/16/2009 7:02 PM
  avalor
119 posts
5th Level Poster


Re: Close UserControl 

Hi palli,

   You know this.close doesnt work because i have the application  area in a usercontrol and usercontrool dont have this.close() method, please help, thx a lot

 
New Post 4/17/2009 12:49 PM
  palli
11189 posts
1st Level Poster




Re: Close UserControl 

Hi avalor,

Sorry, somehow I missed that.

I'm not understanding enough of your logic to be able to give you any specific solutions, and you might be better off sending a sample application to support so we understand each other correctly. I will include our standard sample application request text below.

Before I do that, then some general tips. When you open the form, you add the form (or usercontrol, I'm not understanding you fully here) to the parent's form controls collection. If you would create an event on your child form (or usercontrol), that you would fire when the user requests the child form should close, you could have your parent form listening to that event and when fired, you remove the child form from the controls collection. Would that help ?

And now our standard sample app request text:

Best way to describe those problems is by creating a most minimal application that demonstrates the problem(s) and then send your application to support [at] visualwebgui [dot] com with a link to this forum thread, along with some description about how to reproduce the problem.

Please also clean the solution before compressing it and reply to this post after sending, so we will know to check for your support request.

If connection to database is needed, please make sure you will be using the MSSQL Northwind sample database for your connection(s)

Remember to include information about what VWG version you are using, as well as you Visual Studio version+type and operating system version.

Palli

 


Páll Björnsson - Visual WebGui support team - Email: support@visualwebgui.com
 
Previous Previous
 
Next Next
  Forum  Core :: SDK (Vi...  Developing the ...  Close UserControl
Assessment Bottom
.NET Web, Cloud and Mobile application delivery platform | Sitemap | Terms of Use | Privacy Statement | Copyright © 2005-2011 Visual WebGui®       Visual WebGui weblog on ASP.NET Visual WebGui Group on LinkedIn Visual WebGui updates on Twitter Visual WebGui Page on Facebook Visual WebGui YouTube Channel Visual WebGui Platform News RSS