vb中有没有 Application.ProcessMessages 或 self.Update 的函数?(100分)

  • 主题发起人 主题发起人 hfghfghfg
  • 开始时间 开始时间
H

hfghfghfg

Unregistered / Unconfirmed
GUEST, unregistred user!
vb中有没有 Application.ProcessMessages 或 self.Update 的函数?
 
Application.ProcessMessages
在VB中是DoEvents
self.Update 可以用这个代替InvalidateRect(me.handel,rect,true);
 
哥哥:麻烦你写在下面吧
Private Sub Command_option_ok_Click()
Text_ip.Text = Trim(Text_ip.Text)
Text_port.Text = Trim(Text_port.Text)
WinSock.RemoteHost = Text_ip.Text
If Text_port.Text <> "" then
WinSock.RemotePort = Text_port.Text
End If
Frame_option.Visible = False
/////////////Application.ProcessMessages
////////////哥哥:麻烦你写在这里
/////////////self.Update
////////////哥哥:麻烦你写在这里
If WinSock.RemoteHostIP <> "" then
On Error Resume Next
Timer_hint.Enabled = True

Frame_hint.Caption = "正在连接服务器"
Frame_hint.Caption = True
WinSock.Connect
Timer_hint.Enabled = False

'Process errors
If Err <> 0 then
MsgBox "你选择的服务器不可用,请重新设置服务器!", vbOKOnly, "提示"
my_command ("服务器设置")
End If
End If
End Sub
 
刚查过帮助
DoEvents 会将控制权传给操作系统。当操作系统处理完队列中的事件,并且在 SendKeys 队列中的所有键也都已送出之后,返回控制权。
但是 我用evb ,不认识DoEvents
 
哈哈解决了 在http://www.wince.com.tw 找到的答案
Declare Function PeekMessage Lib "coredll.dll" Alias "PeekMessageW" _
(ByVal MSG As String, ByVal hWnd As Long, ByVal wMsgFilterMin As Integer, _
ByVal wMsgFilterMax As Integer, ByVal wRemoveMsg As Integer) As Boolean
Declare Function TranslateMessage Lib "coredll.dll" (ByVal MSG As String) As Boolean
Declare Function DispatchMessage Lib "coredll.dll" Alias "DispatchMessageW" _
(ByVal MSG As String) As Boolean
Public Const PM_REMOVE = 1
Public Subdo
EventsCE()
Dim msg As String
msg = String(18, Chr(0))
' Get message from queue and dispatch it
If PeekMessage(msg, 0, 0, 0, PM_REMOVE) then
TranslateMessage (msg)
DispatchMessage (msg)
End If
End Sub
 
Delphi的Processmessage源代码
function TApplication.ProcessMessage(var Msg: TMsg): Boolean;
var
Handled: Boolean;
begin
Result := False;
if PeekMessage(Msg, 0, 0, 0, PM_REMOVE) then
begin
Result := True;
if Msg.Message <> WM_QUIT then
begin
Handled := False;
if Assigned(FOnMessage) then
FOnMessage(Msg, Handled);
if not IsHintMsg(Msg) and not Handled and not IsMDIMsg(Msg) and
not IsKeyMsg(Msg) and not IsDlgMsg(Msg) then
begin
TranslateMessage(Msg);
DispatchMessage(Msg);
end;
end
else
FTerminate := True;
end;
end;
 
vb里面用API重画并不能UPDATE组件的状态,用RefResh即可,
 
我用evb//我正在做 pocket pc 的开发
要远离delphi一段时间了
 
哦楼上,我也要用到EVB呀,正在微软那里下载,还有一百多M没下好,可怜咱是拔号呀,到时有问题请教一下,呵呵,
 
to kkyy
推荐
http://www.wince.com.tw
http://www.pdasky.com
以后多联系

 
多谢多谢,好的,呵呵,
 
多人接受答案了。
 
后退
顶部