Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Other Programming > VBScript
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VBScript For questions and discussions related to VBScript.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VBScript section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 20th, 2006, 06:40 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default Change MsgBox title from VBScript to custom

Code:
<INPUT TYPE="BUTTON" NAME="button0" VALUE="Click Here!">
<SCRIPT LANGUAGE="VBScript"> 
Sub button0_onclick 
   MsgBox "Please Click OK", VBYesNo
End Sub 
</SCRIPT>
Is there a way i can Change MsgBox title from VBScript to custom?


www.crmpicco.co.uk
__________________
_______________________
Ayrshire Minis - a Mini E-Community
http://www.ayrshireminis.com
http://www.crmpicco.co.uk
Reply With Quote
  #2 (permalink)  
Old February 20th, 2006, 07:24 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

also....is there a way to redirect to another page with VBScript? my function (so far):
Code:
<SCRIPT LANGUAGE="VBScript"> 
sub Ibrox_Or_Parkhead
    dim the_response
    the_response = MsgBox ("Do you want to perform a Stadium Search?", VBYesNo)
        If the_response = vbYes then

        end If
end sub 
</SCRIPT>

www.crmpicco.co.uk
Reply With Quote
  #3 (permalink)  
Old February 20th, 2006, 08:50 AM
Friend of Wrox
Points: 8,019, Level: 38
Points: 8,019, Level: 38 Points: 8,019, Level: 38 Points: 8,019, Level: 38
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: Mauchline, East Ayrshire, Scotland
Posts: 1,525
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to crmpicco Send a message via AIM to crmpicco Send a message via MSN to crmpicco Send a message via Yahoo to crmpicco
Default

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>CRMPicco</title>
<SCRIPT LANGUAGE="VBScript">
<!--
sub Ibrox_Or_Parkhead
    dim response
    response = MsgBox ("Do you want to perform a stadium Search?", VBYesNo, "Glasgow Rangers")
    If response = vbYes then
        window.location = "rfc_book.asp"
    ElseIf response = vbNo then
        window.location = "multicups/multicups.asp"
    end If
end sub
-->
</SCRIPT> 
</head>
<body onLoad="Ibrox_Or_Parkhead">
</body>
</html>
This is my working function above.
I was wondering if there is a way still to change the 'title' or 'heading' to my MsgBox?
Currently it appears as "VBScript: Glasgow Rangers" in the title of the MsgBox, is there a way to change it to read just "Glasgow Rangers"?
Omitting the VBScript:

Also, are the <!-- lines valid in VBScript as they are in JavaScript?

www.crmpicco.co.uk
Reply With Quote
  #4 (permalink)  
Old May 15th, 2008, 07:56 PM
Registered User
 
Join Date: May 2008
Location: mumias, western, Kenya.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to dashoh Send a message via MSN to dashoh
Default

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'your code should appear exactly as shown
'drag and drop a label from the control box (Label1)
'you are allowed to copy paste
'study keenly how the MsgBox() Title and Caption
'was named and the the attribute declared response As String!
Dim response As String
        response = MsgBox("You wanna know your the time?", vbYesNo, "Check out") 'VbYesNo are the buttons that will appear
' you can also check out others by clicking help or search
'then go to Index and type MsgBox and press enter
        If response = vbYes Then ' the msgbox will appear
'at form_load. It will have two conditions
'the first one, if the user will click on Yes
'this is what will happen
            MsgBox("Hi today is:" & GetTime())
            Label1.Text = GetTime()
'and if the user will click on No(VbNo)
'this is what will happen
        ElseIf response = vbNo Then
            MsgBox("Do Worry")
            Label1.Visible = False
        End If

    End Sub
    Function GetTime()
        Return CStr(Now)
    End Function
End Class


Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change ASP variable in VBScript jimusa Classic ASP Basics 1 August 13th, 2008 07:08 PM
VBScript to change target of Iframe dartcoach BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 May 9th, 2008 11:45 AM
Change title on the fly? darkhalf Javascript 1 March 12th, 2006 04:44 PM
create custom vb form title bar cindy Pro VB 6 1 September 22nd, 2005 02:57 PM
Change the background color of a msgbox nobreferreira VB.NET 2002/2003 Basics 3 October 28th, 2004 09:37 AM



All times are GMT -4. The time now is 05:15 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.