最新更新 sitemap 网站制作设计本站搜索
网页设计
国外网站 韩国网站 个人主页 手提袋设计 CSS 网页特效 平面设计 网站设计 Flash CMS技巧 服装网站 php教程 photoshop 画册 服务器选用 数据库 Office
虚拟主机 域名注册 云主机 网页设计 客服QQ:8208442
当前位置:首页 > 编程开发 > VB开发

VB教程:适当设定水平滚动条的宽度

日期:09-12    来源:中国设计秀    作者:cnwebshow.com

Option Explicit UIJ中国设计秀
Private Const LB_SETHORIZONTALEXTENT = &H194 UIJ中国设计秀
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 UIJ中国设计秀
UIJ中国设计秀
Private Sub Command1_Click() UIJ中国设计秀
Dim max As Long, f As Font, i As Integer UIJ中国设计秀
UIJ中国设计秀
Me.ScaleMode = vbPixels UIJ中国设计秀
Set f = Me.Font UIJ中国设计秀
Set Me.Font = List1.Font UIJ中国设计秀
UIJ中国设计秀
With List1 UIJ中国设计秀
For i = 0 To .ListCount UIJ中国设计秀
If Me.TextWidth(.List(i)) > max Then UIJ中国设计秀
max = Me.TextWidth(.List(i)) UIJ中国设计秀
End If UIJ中国设计秀
Next UIJ中国设计秀
End With UIJ中国设计秀
max = max + 10 UIJ中国设计秀
UIJ中国设计秀
Set Me.Font = f UIJ中国设计秀
UIJ中国设计秀
SendMessage List1.hwnd, LB_SETHORIZONTALEXTENT, max, ByVal 0& UIJ中国设计秀
End Sub UIJ中国设计秀
UIJ中国设计秀
Private Sub Form_Load() UIJ中国设计秀
List1.AddItem "中国设计秀VB教程" UIJ中国设计秀
List1.AddItem "http://www.cnwebshow.com" UIJ中国设计秀
List1.AddItem "这是一个特别特别长的选项,长到超过ListBox的范围" UIJ中国设计秀
End SubUIJ中国设计秀

 UIJ中国设计秀

本文引用地址:/bc/article_61269.html
网站地图 | 关于我们 | 联系我们 | 网站建设 | 广告服务 | 版权声明 | 免责声明