recorrer todas las ventas

  • Thread starter Thread starter Felix González
  • Start date Start date
F

Felix González

Hola

Como puedo recorrer todas los forms creador en una aplicación para maximizar
todos los de un determinado tipo?

Gracias
 
Perdoneme, mi espanol es muy malo.

Soy inseguro de su pregunta. Son usted preguntando como a recorrer en todo
activo forms en su application o el otro application?

A maximizar un form usted puede ponga las propiedad a "maximized" como este:

form1.WindowState = "Maximized"

Espere que este ayude

WhiteWizard
aka Gandalf
MCSD.NET, MCAD, MCT
 
It's Spanish...believe it or not there are people in the world using
Microsoft technologies that don't speak English. I know that might come as a
complete shock. In fact there are probably MORE that speak Spanish than
speak English. (Although MY response might not be able to be considered
actual Spanish...it's pretty bad ;)

WhiteWizard
aka Gandalf
MCSD.NET, MCAD, MCT
 
Hola Felix,

Una de las cosas que se perdio al pasar a .Net fue la colleccion global de
forms que habia en VB6.

Una solucion a tu problema es crear tu propia collecion, y modifica el
constructor para que las formas se auto agreguen a tu collecion, asi despues
puedes recorrerla. El codigo siguiente no lo escribi en VS, pero debe ser
mas o menos correcto:

// esto ponlo como variable global al programa
List<Form> MyForms = new List<Form>();

// esto agregalo a cada constructor de cada forma:
MyForms.Add(This);

// Entoces puedes hacer:
List<Form> Closed = new List<Form>();
for(int iForm; iForm < MyForms.Count; iForm++)
{
if (MyForms[iForm].GetType().FullName == "Nombre del type de forma que
quieres cerrar")
{
Closed.Add(Myforms[iForm];
MyForms[iForm].Close();
}
}

// no puedes modificar la collecion mientras la estas recorriendo, por eso
tienes que hacerlos dos veces
for(int iForm; iForm < Closed.Count; iForm++)
{
MyForms.Remove(Closed[iForm]);
}
Closed.Clear();

Espero que la idea te ayude

Jorge Varas
 
It seems to me that he is looking for the global Forms collection of VB6.
Not there anymore. I speak spanish, I answered him already (If that was his
initial intention with the question)

Jorge Varas
 
Sorry I mistake the forum, I`d want write to spanish forum.

thansk by the respose
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top