⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.frm

📁 本文件包含200个visual baisc实例
💻 FRM
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form Form1 
   Caption         =   "将图像另存为windows墙纸"
   ClientHeight    =   2895
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   5100
   Icon            =   "form1.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   2895
   ScaleWidth      =   5100
   StartUpPosition =   1  '所有者中心
   Begin MSComDlg.CommonDialog Dialog1 
      Left            =   15
      Top             =   660
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin VB.CommandButton Command1 
      Caption         =   "打开图片"
      Height          =   405
      Left            =   3480
      TabIndex        =   4
      Top             =   375
      Width           =   1515
   End
   Begin VB.CommandButton Command3 
      Caption         =   "清除墙纸"
      Height          =   405
      Left            =   3480
      TabIndex        =   3
      Top             =   1485
      Width           =   1515
   End
   Begin VB.CommandButton Command4 
      Caption         =   "退出"
      Height          =   405
      Left            =   3480
      TabIndex        =   2
      Top             =   2070
      Width           =   1515
   End
   Begin VB.CommandButton Command2 
      Caption         =   "另存为墙纸"
      Height          =   405
      Left            =   3480
      TabIndex        =   1
      Top             =   930
      Width           =   1515
   End
   Begin VB.PictureBox Picture1 
      Appearance      =   0  'Flat
      AutoRedraw      =   -1  'True
      BackColor       =   &H80000005&
      ForeColor       =   &H80000008&
      Height          =   2655
      Left            =   105
      ScaleHeight     =   2625
      ScaleWidth      =   3240
      TabIndex        =   0
      Top             =   105
      Width           =   3270
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'函数声明
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByRef lpvParam As Any, ByVal fuWinIni As Long) As Long
Const spi_setdeskwallpaper = 20
Const spif_updateinifile = &H1
Const spif_sendwininichange = &H2

Private Sub Command1_Click()
  Dialog1.ShowOpen
  Picture1.Picture = LoadPicture(Dialog1.FileName)
End Sub

Private Sub Command2_Click()
  SavePicture Picture1.Picture, "c:\windows\wallpaper.bmp"
  Call SystemParametersInfo(spi_setdeskwallpaper, 0, ByVal "c:\windows\wallpaper.bmp", spif_updateinifile)
End Sub

Private Sub Command3_Click()
  Call SystemParametersInfo(spi_setdeskwallpaper, 0, ByVal "", spif_updateinifile)
End Sub

Private Sub Form_Load()
  Picture1.Picture = LoadPicture(App.Path & "\wallpaper.bmp")
End Sub

Private Sub Command4_Click()
  End
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -