Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 143
  • Last Modified:

Large Warning Messages

I am using a number of large warning messages should certain options be taken.

Is there a way of making something like this:-

"It appears that you are planning on making a major change to the existing data - if you take this option again you will lose ALL existing information"


lok like this
_______________________________________
"It Appears that you are planning on
  making a major change to the
         existing data

 If you take this option again you
            will lose
               ALL
      Existing information"
---------------------------------------
Basically what I am after is to use multiple lines of text to form the warning in the msgbox, rather than one line of text that autowraps and quite honestly looks poor.
0
Mister_Simon
Asked:
Mister_Simon
  • 2
  • 2
1 Solution
 
VoodoomanCommented:
Hi!

Make your own message boxes!

Create a form that looks how you want - put a label on it and set the align to centre.


'all form code
Option Explicit

Public FormCaption As String
Public Message As String


Private Sub B_OK_Click()

Unload Me

End Sub

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)

If KeyCode = vbKeyO Then B_OK_Click
End Sub

Private Sub Form_Load()

L_Caption.Caption = Message
Me.Caption = FormCaption
End Sub

This form has a button and a label on it.



Set up a global function and call the message box - here is a big Yes No message box.

Sub BigIMessage(Message As String, Title As String)

F_MsgBoxOK.Message = Message
F_MsgBoxOK.FormCaption = Title
F_MsgBoxOK.Show 1

end sub


'Call it

BigImessage "No Recs Exist!","Error"

You can have as many different Msgboxes as you want - I keep them and reuse them!


Good Luck


Voodooman!
0
 
GordonpCommented:
Insert vbCrLf at strategic Points

ie

sMSg = "It Appears that you are planning on" & vbcrlf _
       & "making a major change to the
         existing data" & vbcrlf _
etc..

MSgBOx sMsg

Gordon

0
 
Mister_SimonAuthor Commented:
Voodooman,

This is too complicated for my purposes and I am only a VB beginner.

I am using Gordonp's answer as this is easy and serves the need perfectly.

Big apologies

Mister Simon
0
 
Mister_SimonAuthor Commented:
Cheers Gordy,

That does the job.

Mister Simon
0
 
GordonpCommented:
Glad to Help

Gordon
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now