View Single Post
  #2 (permalink)  
Old 02-12-2008, 02:39 PM
willisgt's Avatar
willisgt willisgt is offline
Senior Member
 
Join Date: Aug 2007
Location: Nacogdoches, Texas USA
Posts: 154
Default

As far as just centering a control in the middle of the screen goes, it's pretty simple...

Code:
Sub Globals

	'Declare the global variables here.

End Sub

Sub App_Start

	Button2.Visible = false

	Form1.Show
	
End Sub

Sub Form1_Show

End Sub

Sub Button1_Click

	Button2.Left	= ( Form1.Width / 2 ) - ( Button2.Width / 2 )
	Button2.Top	= ( Form1.Height / 2 ) - ( Button2.Height / 2 )
	Button2.Visible	= true

End Sub

Sub Button2_Click

	Button2.Visible = false

End Sub
Forcing the button to the front would probably be a good idea if your form is covered with other controls.

Are your text boxes placed on the form itself, or are you using a panel?


Gary
Attached Files
File Type: sbp center.sbp (758 Bytes, 8 views)
__________________
PC: Windows XP Pro SP2 / Basic4PPC v6.3
PPC: HTC 8925 (AT&T Tilt) / Windows Mobile 6
Reply With Quote