Ahhh...
ThEiMp, that will put a msgbox in the center of the screen and not in the right corner of the window as the OP asked...
kpmsivachand, okay, new standard exe project>add command button>add code...
Now add another form (Form2) and on it add a label (label1)>add code...Code:Option Explicit Private Sub Form_Load() Me.Left = 0 Me.Top = 0 End Sub Private Sub Command1_Click() Load Form2 Form2.QuarterSizeMessage Me, "this is a test" Form2.Show vbModal, Me End Sub
Run>click>seeCode:Option Explicit Public Sub QuarterSizeMessage(WhoCalled As Form, TheMessage As String) Me.Width = (WhoCalled.Width * 0.25) Me.Height = (WhoCalled.Height * 0.25) Me.Left = (WhoCalled.Left + WhoCalled.Width) - Me.Width Me.Top = (WhoCalled.Top) Label1.Left = 0 Label1.Top = 0 Label1.Height = Me.Height Label1.Width = Me.Width Label1.Caption = TheMessage End Sub
Good Luck




Reply With Quote