您的位置:学习中国 推荐教程 VB编程 正文
原作者:kuku 添加时间:2007-06-02 原文发表:2007-06-02 人气:44 来源:互联网

本文章共28074字,分19页,当前第2页,快速翻页:
 
-----------------------------------------------------------------------------------------------------------------------------------------------

本文提示:《vb.net例程集锦(2)》是本站编辑们为广大网友精选的实用文章,本文阐述了关于文章的相关理论,相对来说专业性强,但是本文只是针对于某个问题提出的见解与论述,未必能辐射到相关问题的方方面面,所以本文处理问题的方法仅仅为您提供一些参考。更多问题请查阅学习中国网其他栏目哦.

-----------------------------------------------------------------------------------------------------------------------------------------------



Dim Reg As Microsoft.Win32.RegistryKey
Private Sub InitVar()
If btnSave.Visible = True Then

End If
Reg = CurrentUser.OpenSubKey(\"Software\\Microsoft\\Windows\\CurrentVersion\\Run\", True)
If Reg.GetValue(\"MengXianHui\") <> \"\" Then
CheckBox1.Checked = True
Else
CheckBox1.Checked = False
End If
End Sub
Private Sub SaveSettings()
If CheckBox1.Checked = True Then
Reg = CurrentUser.OpenSubKey(\"Software\\Microsoft\\Windows\\CurrentVersion\\Run\", True)
Reg.SetValue(\"MengXianHui\", Application.ExecutablePath)
Else
Reg = CurrentUser.OpenSubKey(\"Software\\Microsoft\\Windows\\CurrentVersion\\Run\", True)
Reg.SetValue(\"MengXianHui\", \"\")
End If
InitVar()
MessageBox.Show(\"您已经设置了,请重新启动计算机看效果。\", \"提示\", _
MessageBoxButtons.OK, MessageBoxIcon.Information)
If CheckBox1.Checked = True Then
Me.Dispose(True)
End If
End Sub

Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles btnSave.Click
SaveSettings()
End Sub
End Class


把图象文件转换成XML格式文件
利用.NET 框架下的FromBase64String和ToBase64String方法可以很容易地实现图象文件和XML文件的互换。这样可以轻易解决以XML格式保存图片的问题。代码如下:

Public Class Form1
Inherits System.Windows.Forms.Form

#Region \" Windows 窗体设计器生成的代码 \"
Public Sub New()
MyBase.New()
InitializeComponent()
\'在 InitializeComponent() 调用之后添加任何初始化
End Sub

\'窗体重写处置以清理组件列表。
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub

\'Windows 窗体设计器所必需的
Private components As System.ComponentModel.IContainer
\'注意:以下过程是 Windows 窗体设计器所必需的
\'可以使用 Windows 窗体设计器修改此过程。
\'不要使用代码编辑器修改它。
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
Friend WithEvents Button3 As System.Windows.Forms.Button
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Private Sub InitializeComponent()
Me.Button1 = New System.Windows.Forms.Button()
Me.Button2 = New System.Windows.Forms.Button()
Me.PictureBox1 = New System.Windows.Forms.PictureBox()
Me.Button3 = New System.Windows.Forms.Button()
Me.Label1 = New System.Windows.Forms.Label()
Me.Label2 = New System.Windows.Forms.Label()
Me.SuspendLayout()
\'
\'Button1
\'
Me.Button1.Location = New System.Drawing.Point(365, 63)
Me.Button1.Name = \"Button1\"
Me.Button1.Size = New System.Drawing.Size(115, 23)
Me.Button1.TabIndex = 0
Me.Button1.Text = \"将图象保存成XML\"
\'
\'Button2
\'
Me.Button2.Location = New System.Drawing.Point(365, 98)
 
本文章更多内容<<上一页 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 下一页>>
本页地址
收藏到:[收藏夹] [百度搜藏] [新浪ViVi] [POCO网摘] [ 和讯网摘] [好哦网摘] [Google书签]
               
[搜狐网摘] [365Key网摘] [天极网摘] [我摘] [博采网摘] [igooi网摘]
相关文章

在VB.NET中获得功能加强的分类和查询数组
解析Visual Basic.NET事件编程
VB.NET中对象的克隆
VB.Net编程入门之Hello World 入门篇
VB 神童教程第二章第九节——综合示例三
VB 神童教程第二章第八节——组合框控件
VB 神童教程第二章第七节——列表框控件
VB 神童教程第二章第六节——综合示例二
VB 神童教程第二章第五节——单选与复选控件
VB 神童教程第二章第四节-CommandButton控件
向SQL Server数据库添加图片和文字
多个窗体之间如何互相调用
如何拖动没有边框的窗体?
怎么让窗体透明后,控件不透明?
Video/ Audio压缩数据流播放技术
VB程序中处理随机事件
VB编程的必备技巧
VB6制作Win98风格的工具栏
VB实现窗口的弹出式菜单
用VB6实现动态增减控件

相关评论


本文章所属分类:首页 推荐教程 VB编程   VB编程