![]() MessageLabel.Font = New Font("Arial", 12, FontStyle.Regular, GraphicsUnit.Point) MessagePanel.BorderStyle = BorderStyle.FixedSingle MessagePanel.Location = New (Me.Width / 2 - 200, Me.Height / 2 - 100) It is put into DoMsgResp so you see what is in it to handle the response.Ĭreate the message panel when opening the form by calling MakeMsgPanel() Dim MessagePanel As New Panel 'The panelĭim MessageLabel As New Label 'The messageĭim MsgYes As New Button 'Yes or OK buttonĭim Sleepsecs As Integer 'How long panel shows forĭim DoMsgResp As Integer 'response 1, 2 or 3 depending which button clicked The responses are 1 if Ok or Yes is clicked, 2 if No is clicked, 3 if Cancel is clicked If seconds and buttons are both specified, If no button is clicked the panel will just hide after the timeout. If seconds is 0 or not specified then the time to show the panel is set to a long time (10000 seconds) If Buttons to show is not specified it is set to Ok button only. To call the message panel DoMessage("The message", Seconds, Buttons to show 1 = Ok only 2 = Yes(ok) and No, 3 = Yes, No and Cancel. To overcome these problems I created a custom Message Box using a panel on the form I had on the main screen. I also had the problem that when using extended screen that the msgbox showed up on the extended screen (which was a different form) instead of on the main computer screen. ![]() In Visual Basic 2008 I had a requirement for a message box that would only stay on for short times and that the time it was on to be variable. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |