ImageVerifierCode 换一换
格式:DOCX , 页数:6 ,大小:16.73KB ,
资源ID:17292321      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/17292321.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(IP地址输入框Word文档格式.docx)为本站会员(b****6)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

IP地址输入框Word文档格式.docx

1、 If User32.InitCommonControlsEx(CommCtrl) Then CtlHwnd = User32.CreateWindowEx(0, SysIPAddress32, , _ User32.Constants.WS_CHILD Or User32.Constants.WS_TABSTOP Or User32.Constants.WS_VISIBLE, 0, 0, 132, 21, _ Me.Handle, IntPtr.Zero, GetInstance, IntPtr.Zero) If CtlHwnd.Equals(IntPtr.Zero) = False The

2、n 将IP控件的字体设置的根窗体一样 用宋体 Dim hFont As IntPtr = Me.Font.ToHfont() User32.SendMessage(CtlHwnd, User32.WindowsMessages.WM_SETFONT, hFont, IntPtr.Zero) End If Else End Sub Control 重写 dispose 以清理组件列表。 Protected Overloads Overrides Sub Dispose()Sub Dispose(ByVal disposing As Boolean) If CtlHwnd.Equals(IntPt

3、r.Zero) = False Then User32.DestroyWindow(CtlHwnd) If disposing Then If Not (components Is Nothing) Then components.Dispose() MyBase.Dispose(disposing) End Sub 控件设计器所必需的 Private components As System.ComponentModel.IContainer 注意: 以下过程是组件设计器所必需的 可以使用组件设计器修改此过程。不要使用 代码编辑器修改它。 <System.Diagnostics.Deb

4、uggerStepThrough()> Private Sub InitializeComponent()Sub InitializeComponent() components = New System.ComponentModel.Container End Sub#End Region Protected Overrides Sub OnPaint()Sub OnPaint(ByVal pe As System.Windows.Forms.PaintEventArgs) MyBase.OnPaint(pe) 在此添加自定义绘画代码 End Sub Private Sub IPTex

5、tBox_SizeChanged()Sub IPTextBox_SizeChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.SizeChanged If CtlHwnd.Equals(IntPtr.Zero) = False Then User32.SetWindowPos(CtlHwnd, 0, 0, 0, Me.Width, Me.Height, &H22) End Sub Private CtlHwnd As IntPtrPropertys#Region Propertys Pub

6、lic Overrides Property Text()Property Text() As String Get Dim TempLng As Integer = 0 Dim tmpLng As IntPtr = System.Runtime.InteropServices.Marshal.AllocHGlobal(4) Try User32.SendMessage(CtlHwnd, User32.Constants.IPM_GETADDRESS, IntPtr.Zero, tmpLng) TempLng = System.Runtime.InteropServices.Marshal.R

7、eadInt32(tmpLng) Catch ex As Exception MsgBox(ex.Message) End Try System.Runtime.InteropServices.Marshal.FreeHGlobal(tmpLng) Return FIRST_IPADDRESS(TempLng) & . SECOND_IPADDRESS(TempLng) & THIRD_IPADDRESS(TempLng) & FOURTH_IPADDRESS(TempLng) End Get Set(ByVal Value As String) If Value = String.Empty

8、 Then Value = If Value.Split().Length & 4 Then Value = If Value & Then User32.SendMessage(CtlHwnd, User32.Constants.IPM_SETADDRESS, IntPtr.Zero, New IntPtr(MakeIPAddess(Value) End Set End Property#End RegionFunctions#Region Functions &summary& 获取应用程序的进程句柄/summary&returns&/returns&remarks&/remarks& P

9、rivate Function GetInstance()Function GetInstance() As IntPtr Dim tmpType As Type = Me.GetType Dim tmpModule As System.Reflection.Module = tmpType.Module Return System.Runtime.InteropServices.Marshal.GetHINSTANCE(tmpModule) End Function Private Function FIRST_IPADDRESS()Function FIRST_IPADDRESS(ByVa

10、l x As Int32) As Byte FIRST_IPADDRESS = (x And &H7F000000) &H1000000) Or (x And &H80000000) & 0) And &H80) End Function Private Function SECOND_IPADDRESS()Function SECOND_IPADDRESS(ByVal x As Int32) As Byte SECOND_IPADDRESS = (x And &HFF0000) &H10000 End Function Private Function THIRD_IPADDRESS()Fu

11、nction THIRD_IPADDRESS(ByVal x As Int32) As Byte THIRD_IPADDRESS = (x And &HFF00&) &H100 End Function Public Function FOURTH_IPADDRESS()Function FOURTH_IPADDRESS(ByVal x As Int32) As Byte FOURTH_IPADDRESS = x And &HFF End Function Private Function MAKEIPRANGE()Function MAKEIPRANGE(ByVal low As Byte,

12、 ByVal high As Byte) As Int32 MAKEIPRANGE = high * &H100& Or low End Function Private Function MakeIPAddess()Function MakeIPAddess(ByVal b1 As Byte, ByVal b2 As Byte, ByVal b3 As Byte, ByVal b4 As Byte) As Int32 Return (b1 And &H7F) * &H1000000 Or (b1 And &H80) & 0 And &H80000000) Or (b2 * &H10000)

13、Or (b3 * &) Or (b4) End Function Private Function MakeIPAddess()Function MakeIPAddess(ByVal IPAddress As String) As Int32 Dim ips As String() = IPAddress.Split() If ips.Length & 4 Then ips = New String() 0 Dim cout As Int32 = 0 For i As Integer = 0 To 3 If Not IsNumeric(ips(i) Then Throw New Excepti

14、on(IP地址错误! cout = (cout & 8) Or (Val(ips(i) And &HFF) Next Return cout End Function#End Region End Class Public Class User32Class User32 &DllImport(user32, EntryPoint:=CreateWindowExA, CharSet:=CharSet.Ansi, SetLastError:=True, ExactSpelling:=True)& _ Public Shared Function CreateWindowEx()Function

15、CreateWindowEx(ByVal dwExStyle As Integer, &MarshalAs(UnmanagedType.VBByRefStr)& ByRef lpClassName As String, & ByRef lpWindowName As String, ByVal dwStyle As Integer, ByVal x As Integer, ByVal y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hWndParent As IntPtr, ByVal hMenu A

16、s IntPtr, ByVal hInstance As IntPtr, ByVal lpParam As IntPtr) As IntPtr End Function & Public Shared Function DestroyWindow()Function DestroyWindow(ByVal hwnd As IntPtr) As IntegerSendMessageA Public Shared Function SendMessage()Function SendMessage(ByVal hwnd As Integer, ByVal wMsg As Integer, ByVa

17、l wParam As Integer, ByVal lParam As Integer) As Integer End Function Public Shared Function SendMessage()Function SendMessage(ByVal hwnd As IntPtr, ByVal wMsg As Integer, ByVal wParam As IntPtr, ByVal lParam As IntPtr) As IntPtr Public Shared Function SetWindowPos()Function SetWindowPos(ByVal hwnd

18、As IntPtr, ByVal hWndInsertAfter As Integer, ByVal x As Integer, ByVal y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal wFlags As Integer) As Integercomctl32.dll Public Shared Function InitCommonControlsEx()Function InitCommonControlsEx(ByRef TLPINITCOMMONCONTROLSEX As Structures.InitCo

19、mmonControls) As Integer End Function Fields Public Const MENU_CLASS As String = #32768 Nested Types Public Enum ConstantsEnum Constants ICC_INTERNET_CLASSES = 2048 IPM_CLEARADDRESS = 1124 IPM_GETADDRESS = 1126 IPM_SETADDRESS = 1125 WS_CHILD = 1073741824 WS_TABSTOP = 65536 WS_VISIBLE = 268435456 End

20、 Enum Public Class StructuresClass Structures &StructLayout(LayoutKind.Sequential)& Public Structure InitCommonControlsStructure InitCommonControls Fields Public dwICC As Integer Public dwSize As Integer End Structure & Public Structure WINDOWPOSStructure WINDOWPOS Public cx As Integer Public cy As Integer Public flags As Integer Public hWnd As IntPtr Public hWndInsertAfter As IntPtr Public x As Integer Public y As Integer End Structure End Class Public Enum WindowsMessagesEnum WindowsMessages WM_SETFONT = 48 End Enum End ClassEnd Namespace

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1