VB.NET中能否做一个像QQ那样的聊天框,可以输入文字和图片?
第一个问题 qq聊天室 必须能 用vb都可以做
我们提供的服务有:成都做网站、网站设计、微信公众号开发、网站优化、网站认证、七星关区ssl等。为数千家企事业单位解决了网站和推广的问题。提供周到的售前咨询和贴心的售后服务,是有科学管理、有技术的七星关区网站制作公司
第二个问题 vb.net插入数学公式 可以把这些公式封装到一个类中,调用就是了
VB.NET中,如何动态创建非模态窗体,类似于QQ一样,双击一个头像会弹出一个窗口。
做一个窗体模板,假设是Form2
Dim x as New Form2
x.Show()
如果弹出窗口较多,x可以用动态数组替代
VB如何实现仿QQ消息盒子效果
终于写完了,累死我了、
在窗体上添加一个Timer控件,interval的值设置为1000,也就是周期为1秒。
然后再添加一个Form2和一个模块
form1中的代码
'--------------------------------------------------------------------------------------------------------------------------------------
Option Explicit
Private Type POINTAPI
x As Long
y As Long
End Type
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Dim HJonny As POINTAPI, mForm As RECT
Private Sub Form_Load()
Me.Hide
Load Form2
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Timer1.Enabled = True
End Sub
Private Sub Form_Queryunload(Cancel As Integer, unloadmode As Integer)
Cancel = True
End Sub
Private Sub Timer1_Timer()
Dim x, y
GetCursorPos HJonny
GetWindowRect Me.hwnd, mForm
x = HJonny.x
y = HJonny.y
If x mForm.Left And x mForm.Left + (mForm.Right - mForm.Left) And y mForm.Top And y mForm.Top + (mForm.Bottom - mForm.Top) Then
Else
Me.Hide
End If
End Sub
'----------------------------------------------------------------------------------------------------------------------------------------
form2中的代码,首先在Form2的窗体上右键---菜单编辑器,在标题处输入 文件(F) ,名称处输入 Files ,再在底下的列表框中第一行"文件(F)"这个的下面,也就是第二行,点一下,会选中一行空白,再点一下上面的黑的冲着右面的小箭头,然后再在上面标题处输入 退出(E) 名称处输入 Exit 然后点确定。代码如下!
'--------------------------------------------------------------------------------------------------------------------------------------
Private Declare Function Shell_NotifyIcon Lib "shell32.dll" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, lpData As NOTIFYICONDATA) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const WM_SYSCOMMAND = H112
Private Const SC_RESTORE = HF120
Private LastState As Integer '保留原窗口状态
'---------- dwMessage可以是以下NIM_ADD、NIM_DELETE、NIM_MODIFY 标识符之一----------
Private Const NIM_ADD = H0 '在任务栏中增加一个图标
Private Const NIM_DELETE = H2 '删除任务栏中的一个图标
Private Const NIM_MODIFY = H1 '修改任务栏中个图标信息
Private Const NIF_MESSAGE = H1 'NOTIFYICONDATA结构中uFlags的控制信息
Private Const NIF_ICON = H2
Private Const NIF_TIP = H4
Private Const WM_MOUSEMOVE = H200 '当鼠标指针移至图标上
Private Const WM_LBUTTONUP = H202
Private Const WM_RBUTTONUP = H205
Private Type NOTIFYICONDATA
cbSize As Long '该数据结构的大小
hwnd As Long '处理任务栏中图标的窗口句柄
uID As Long '定义的任务栏中图标的标识
uFlags As Long '任务栏图标功能控制,可以是以下值的组合(一般全包括)
'NIF_MESSAGE 表示发送控制消息;
'NIF_ICON表示显示控制栏中的图标;
'NIF_TIP表示任务栏中的图标有动态提示。
uCallbackMessage As Long '任务栏图标通过它与用户程序交换消息,处理该消息的窗口由hWnd决定
hIcon As Long '任务栏中的图标的控制句柄
szTip As String * 64 '图标的提示信息
End Type
Dim myData As NOTIFYICONDATA
Private Sub Exit_Click()
Shell_NotifyIcon NIM_DELETE, myData
End
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Dim Msg As Long
Msg = x \ Screen.TwipsPerPixelX
Select Case Msg
Case H202 '左键
Form1.Show
Case H205 '右键
PopupMenu Form2.Files
End Select
Call Form_ShowUp
End Sub
Private Sub Form_Load()
With myData
.cbSize = Len(myData)
.hwnd = Me.hwnd
.uID = 0
.uFlags = NIF_ICON Or NIF_MESSAGE Or NIF_TIP
.uCallbackMessage = WM_MOUSEMOVE
.hIcon = Form1.Icon.Handle '默认为窗口图标
.szTip = "HJonny-绝对↘0℃" vbNullChar
End With
Shell_NotifyIcon NIM_ADD, myData
End Sub
Private Sub Form_Unload(Cancel As Integer)
Shell_NotifyIcon NIM_DELETE, myData '窗口卸载时,将状态栏中的图标一同卸载
End Sub
'--------------------------------------------------------------------------------------------------------------------------------------
模块中的代码
Option Explicit
Public Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Const SPI_GETWORKAREA = 48
Public 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
Public Function GetTaskbarHeight() As Integer
Dim lRes As Long
Dim rectVal As RECT
lRes = SystemParametersInfo(SPI_GETWORKAREA, 0, rectVal, 0)
GetTaskbarHeight = (Screen.Height / Screen.TwipsPerPixelX) - rectVal.Bottom
End Function
Public Sub Form_ShowUp()
Form1.Move Screen.Width - Form1.Width, Screen.Height - Form1.Height - (GetTaskbarHeight() * 15)
Form1.Show
End Sub
好了,希望能对你有帮助,自己写的,代码不太工整,见笑。。
VB怎样仿QQ的截取影片图像
Option Explicit
Private Declare Sub keybd_event Lib "user32" _
(ByVal bVk As Byte, _
ByVal bScan As Byte, _
ByVal dwFlags As Long, _
ByVal dwExtraInfo As Long)
截全屏的:
Private Sub Form_Click()
keybd_event vbKeySnapshot, 0, 0, 0
DoEvents
Me.Picture = Clipboard.GetData(vbCFBitmap)
End Sub
VB.net什么控件能实现像QQ表情栏那样存放连续图片
VB.NET标准控件库中是没有这个控件的,不过既然提供了picturebox,类似你说的这样的可以连续存放多个图片的控件是可以通过代码动态添加控件来实现,也可以通过vb.net中的GDI+函数代码编程实现。
VB NET,像QQ登录界面、酷狗那种窗体是怎么做出来的?
这个问题很简单,但是,要自己去写事件,不然,窗体就是一个死窗体了
分享名称:包含仿qqvb.net的词条
当前地址:http://lswzjz.com/article/hheipg.html