Power Builder - Como centrar ventana en XP??????

 
Vista:

Como centrar ventana en XP??????

Publicado por Francisco (12 intervenciones) el 08/08/2005 17:22:44
COMO PUEDO HACER PARA QUE UNA VENTANA QUEDE SIEMPRE CENTRADA CON SU TAMAÑO EN DIFERENTES WINDOWS, YA QUE UTILIZO UNA FUNCIÓN ACTUALMENTE PERO NO ME RESULTA EN WINDOWS XP. ¡ME PUEDEN ENVIAR UN EJEMPLO POR FAVOR? MUCHAS GRACIAS...


Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Como centrar ventana en XP??????

Publicado por Jorge (900 intervenciones) el 08/08/2005 18:05:40
Hola
Fijate con este codigo

Ahora si estas con la Version 9
es una propiedad de la windows
solo debes activar la casilla Center.

//*-----------------------------------------------------------------*/
//* f_Center: Center the window
//*-----------------------------------------------------------------*/
int li_screenheight, li_screenwidth, li_rc, li_x=1, li_y=1
environment lenv_obj

/* Check for a window association with this object */
If IsNull ( this ) Or Not IsValid ( this ) Then Return -1

/* Get environment */
If GetEnvironment ( lenv_obj ) = -1 Then Return -1

/* Determine current screen resolution and validate */
li_screenheight = PixelsToUnits ( lenv_obj.ScreenHeight, YPixelsToUnits! )
li_screenwidth = PixelsToUnits ( lenv_obj.ScreenWidth, XPixelsToUnits! )
If Not ( li_screenheight > 0 ) Or Not ( li_screenwidth > 0 ) Then Return -1

/* Get center points */
If li_screenwidth > this.Width Then
li_x = ( li_screenwidth / 2 ) - ( this.Width / 2 )
End If
If li_screenheight > this.Height Then
li_y = ( li_screenheight / 2 ) - ( this.Height / 2 )
End If

/* Center window */
li_rc = this.Move ( li_x, li_y )
If li_rc <> 1 Then Return -1
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar