-- 作者:baoxyang
-- 发布时间:2014/8/6 17:52:00
-- 在win7出错,XP不会。
AfterOpenProject 代码内容如下:
Dim n As Integer = Registry.GetValue("HKEY_CURRENT_USER\\Software\\MyApp","Count",0) Dim Code As String = Registry.GetValue("HKEY_CURRENT_USER\\Software\\MyApp","Register" & ComputerId,"") Dim Ok As Boolean = False Vars("内外网") = User.ExtendedValues("登陆方式")
baseMainform.MinimizeBox = True If Code > "" AndAlso DecryptText(Code,"yang139264","139264yang") = ComputerId Then Registry.SetValue("HKEY_CURRENT_USER\\Software\\MyApp","Count",n+1) Forms("登陆").Open() InitNotifyIcon() Else If n > 350 And n <= 380 Then Forms("注册窗口").Open() Else If n > 380 Then Messagebox.Show("您正在使用的产品已经超出试用次数!") Syscmd.Project.Exit(False) Else Registry.SetValue("HKEY_CURRENT_USER\\Software\\MyApp","Count",n+1) Forms("登陆").Open() InitNotifyIcon() End If End If BaseMainform.IsMdiContainer = True baseMainform.FormBorderStyle = Windows.Forms.FormBorderStyle.FixedDialog \'项目固定大小,不可调整 此主题相关图片如下:snap 2014-08-06 17.45.23.jpg
|
-- 作者:baoxyang
-- 发布时间:2014/8/6 17:55:00
--
在全局中代码如下:
Public NotifyIcon As New System.Windows.Forms.NotifyIcon() Public menu As New System.Windows.Forms.ContextMenuStrip() \'初始化组件.此函数在AfterOpenProject事件中调用 Public Sub InitNotifyIcon() Dim menu1 As New System.Windows.Forms.ToolStripMenuItem() Dim menu2 As New System.Windows.Forms.ToolStripMenuItem() menu1.Text = "最大化" menu2.Text = "退出系统" menu.Items.Add(menu1) menu.Items.Add(menu2) AddHandler menu1.Click, AddressOf seo1 \'事件注册,表示点菜单1的时候执行方法1 AddHandler menu2.Click, AddressOf seo2
NotifyIcon.Ballo \'+ vbcrlf + "Win7用户请注意,图标会自动隐藏.需要设置为""显示图标和通知""" NotifyIcon.Icon = New Icon("Images\\001.ico") NotifyIcon.Visible = False NotifyIcon.ContextMenuStrip = menu End Sub 是否win7不支持?还是上面哪句代码有问题。请教各位!!
|