下载频道> 资源分类> 编程语言> VB源码> 控制MessageBox VB源码程序

标题:控制MessageBox VB源码程序
分享到:

所属分类: VB源码 资源类型: 文件大小: 6.13 KB 上传时间: 2016-01-21 19:00:52 下载次数: 7 资源积分:1分 提 供 者: vb源码代做 控制MessageBox VB源码程序
内容:
控制MessageBox VB源码程序,程序员在编程的过程中可以参考学习使用,希望对IT程序员有用,此源码程序简单易懂、方便阅读,有很好的学习价值!
部分代码如下:
VERSION 5.00
Begin VB.Form frmManipulateMsgBox 
   AutoRedraw      =   -1  'True
   Caption         =   "控制MessageBox"
   ClientHeight    =   2940
   ClientLeft      =   750
   ClientTop       =   750
   ClientWidth     =   4965
   LinkTopic       =   "Form1"
   ScaleHeight     =   196
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   331
   Begin VB.CommandButton Command3 
      Caption         =   "对话框改变字体"
      Height          =   375
      Left            =   1365
      TabIndex        =   2
      Top             =   1860
      Width           =   2250
   End
   Begin VB.CommandButton Command2 
      Caption         =   "对话框居中于窗体"
      Height          =   375
      Left            =   1350
      TabIndex        =   1
      Top             =   1275
      Width           =   2250
   End
   Begin VB.CommandButton Command1 
      Caption         =   "对话框自动关闭"
      Height          =   375
      Left            =   1350
      TabIndex        =   0
      Top             =   705
      Width           =   2250
   End
End
Attribute VB_Name = "frmManipulateMsgBox"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
  Option Explicit
  ' demo project showing how to use the API to manipulate a messagebox
  ' by Bryan Stafford of New Vision Software?- newvision@imt.net
  ' this demo is released into the public domain "as is" without
  ' warranty or guaranty of any kind.  In other words, use at
  ' your own risk.
 
Private Sub Command1_Click()
  ' this shows a messagebox that will be dismissed after 4 seconds
  
  ' set the callback timer and pass our application defined ID (NV_CLOSEMSGBOX)
  ' set the time for 4 seconds (4000& microseconds)
  SetTimer hWnd, NV_CLOSEMSGBOX, 4000&, AddressOf TimerProc
 
  ' call the messagebox API function
  Call MessageBox(hWnd, "4 秒钟后此对话框自动关闭", _
      "Self Closing Message Box", MB_ICONQUESTION Or MB_TASKMODAL)
  
End Sub
 
Private Sub Command2_Click()
  ' this positions the messagebox in the desired location on the screen.
  ' the location is defined in the callback timer function
  
  ' lock the desktop so that the initial position is not shown
  Call LockWindowUpdate(GetDesktopWindow())
  
  ' set the callback timer with our application defined ID (NV_MOVEMSGBOX)
  ' set the time for 10 microseconds to allow the messagebox time to become active
  SetTimer hWnd, NV_MOVEMSGBOX, 10&, AddressOf TimerProc
 
  ' call the messagebox API function
  Call MessageBox(hWnd, "对话框居中于窗体(而不是屏幕)?", _
                                        "Position A Message Box", MB_ICONQUESTION Or MB_TASKMODAL)
 
End Sub
 
Private Sub Command3_Click()
  ' this changes th font for the message text of the messagebox.
  ' the routine in the callback timer function
  
  ' lock the desktop so that the initial font is not shown
  Call LockWindowUpdate(GetDesktopWindow())
  
  ' set the callback timer with our application defined ID (NV_MSGBOXCHNGFONT)
  ' set the time for 10 microseconds to allow the messagebox time to become active
  SetTimer hWnd, NV_MSGBOXCHNGFONT, 10&, AddressOf TimerProc
 
  ' call the messagebox API function
  Call MessageBox(hWnd, MSGBOXTEXT, "Change The Message Box Font", MB_ICONQUESTION Or MB_TASKMODAL)
 
End Sub
 
Private Sub Form_Load()
 
  ' we will use the font from the form to change the text in one of our message boxes
  ' first, set the attributes of the font that we will want to display.
  With Font
    .Bold = True
    .Italic = True
  End With
  
  ' next, grab a handle to the form's font and store it in the global variable for use later.
  ' don't change the font on the form or the value in the global variable will be invalid.
  Dim IFont As IFont
  Set IFont = Font
 
  g_hBoldFont = IFont.hFont
  
  Set IFont = Nothing
  
End Sub
 

文件列表(点击上边下载按钮,如果是垃圾文件请在下面评价差评或者投诉):

控制MessageBox VB源码程序/
控制MessageBox VB源码程序/MManipulateMsgBox.bas
控制MessageBox VB源码程序/MSSCCPRJ.SCC
控制MessageBox VB源码程序/PManipulateMsgBox.vbp
控制MessageBox VB源码程序/PManipulateMsgBox.vbw
控制MessageBox VB源码程序/Project1.vbw
控制MessageBox VB源码程序/frmManipulateMsgBox.frm

关键词: 源码 程序

编程语言下载排行

Top_arrow
回到顶部
联系方式| 版权声明| 招聘信息| 广告服务| 银行汇款| 法律顾问| 兼职技术| 付款方式| 关于我们|
网站客服网站客服 程序员兼职招聘 程序员兼职招聘
沪ICP备19040327号-3
公安备案号:沪公网安备 31011802003874号
库纳格流体控制系统(上海)有限公司 版权所有
Copyright © 1999-2014, GUSUCODE.COM, All Rights Reserved