免费预览已结束,剩余1页可下载查看
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
可以直接用API改变textbox的扩展样可以直接用API改变textbox的扩展样式VERSION 5.00 Begin VB.Form Form1 Caption = Form1 ClientHeight = 6135 ClientLeft = 165 ClientTop = 735 ClientWidth = 7080 LinkTopic = Form1 ScaleHeight = 6135 ScaleWidth = 7080 StartUpPosition = 3 Windows Default Begin VB.CommandButton Command2 Caption = Command2 Height = 375 Left = 4800 TabIndex = 4 Top = 5040 Width = 1455 End Begin VB.PictureBox Pic1 BorderStyle = 0 None Height = 495 Left = 960 ScaleHeight = 495 ScaleWidth = 2655 TabIndex = 5 Top = 2880 Width = 2655 End Begin VB.Timer Timer1 Interval = 10 Left = 240 Top = 3120 End Begin VB.CheckBox Check1 Caption = 选择,再看按钮的文字,然后不要选择 Height = 855 Left = 960 TabIndex = 1 Top = 3600 Width = 4575 End Begin VB.CommandButton Command1 Caption = 歪歪的VB技巧演示 Height = 1695 Left = 360 TabIndex = 0 Top = 960 Width = 5295 End Begin VB.TextBox Text1 Height = 495 Left = 1080 MultiLine = -1 True TabIndex = 3 Top = 5040 Width = 2415 End Begin VB.Label Label1 Caption = Label1 Height = 375 Left = 600 TabIndex = 2 Top = 240 Width = 1215 End Begin VB.Menu mnuChange Caption = 改变样式(&C) Begin VB.Menu mnuFlash Caption = FlashWindow(&F) End End End Attribute VB_Name = Form1 Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False 这是我机子中的一个例子,包含了你说的那个功能,我想就没必要再改了,凑合着看看应该可以吧:) Private Declare Function SetWindowPos Lib user32 (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long Alignment constants Private Const BS_CENTER& = &H300& Private Const BS_LEFT& = &H100& Private Const BS_RIGHT& = &H200& Private Const BS_TOP& = &H400& Private Const GWL_STYLE& = (-16) Private Const GWL_EXSTYLE = (-20) Private Const WS_EX_TRANSPARENT = &H20& Private Const WS_THICKFRAME = &H40000 Private Const WS_BORDER = &H400000 Private Const WS_EX_CLIENTEDGE = &H200& Dim FlashYn As Boolean, Yn As Boolean API Calls Private Declare Function GetWindowLong& Lib user32 Alias GetWindowLongA (ByVal hwnd As Long, ByVal nIndex As Long) Private Declare Function SetWindowLong& Lib user32 Alias SetWindowLongA (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) Private Declare Function FlashWindow Lib user32 (ByVal hwnd As Long, ByVal bInvert As Long) As Long Const SWP_DRAWFRAME = &H20 Const SWP_NOMOVE = &H2 Const SWP_NOSIZE = &H1 Const SWP_NOZORDER = &H4 Const SWP_FRAMECHANGED = &H20 The frame changed: send WM_NCCALCSIZE Private Sub Check1_Click() Declare Variables Dim tmpValue&, ret& Dim Align& Check if the state is checked If Check1.Value = Checked Then Yes fAlignment& = BS_LEFT tmpValue& = GetWindowLong&(Command1.hwnd, GWL_STYLE) And Not BS_RIGHT ret& = SetWindowLong&(Command1.hwnd, GWL_STYLE, tmpValue& Or fAlignment&) Command1.Refresh Else No fAlignment& = BS_CENTER tmpValue& = GetWindowLong&(Command1.hwnd, GWL_STYLE) And Not BS_RIGHT Or BS_LEFT ret& = SetWindowLong&(Command1.hwnd, GWL_STYLE, tmpValue& Or fAlignment&) Command1.Refresh End If End Sub Private Sub Command2_Click() Declare Variables Dim tmpValue&, ret& Dim Align& Check if the state is checked tmpValue& = (GetWindowLong&(Text1.hwnd, GWL_EXSTYLE) Or WS_EX_CLIENTEDGE) And Not WS_BORDER ret& = SetWindowLong&(Text1.hwnd, GWL_EXSTYLE, tmpValue&) tmpValue& = (GetWindowLong&(Text1.hwnd, GWL_STYLE) Or WS_THICKFRAME) And Not WS_BORDER ret& = SetWindowLong&(Text1.hwnd, GWL_STYLE, tmpValue&) SetWindowPos Text1.hwnd, Me.hwnd, 0, 0, 0, 0, SWP_NOSIZE Or SWP_NOMOVE Or SWP_NOZORDER Or SWP_DRAWFRAME Text1.Refresh End Sub - VB WorkShop 2000 Private Sub Form_Load() Dim tmpValue&, ret& FlashYn = False: Yn = False tmpValue& = GetWindowLong&(Me.hwnd, GWL_EXSTYLE) ret& = SetWindowLong&(Me.hwnd, GWL_EXSTYLE, tmpValue& Or WS_EX_TRANSPARENT) tmpValue& = GetWindowLong&(Check1.hwnd, GWL_EXSTYLE) ret& = SetWindowLong&(Check1.hwnd, GWL_EXSTYLE, tmpValue& Or WS_EX_TRANSPARENT) Command1.Refresh Che
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026年马鞍山含山县电子商务公共服务中心招聘笔试参考题库及答案解析
- 2026山东滨州市高校毕业生三支一扶计划招募补充笔试备考试题及答案解析
- 2026年哈尔滨铁道职业技术学院教师招聘考试参考试题及答案解析
- 2026陕西西安文理学院高层次人才和紧缺特殊专业人才引进50人考试备考试题及答案解析
- 2026上海市质子重离子医院招聘4人考试模拟试题及答案解析
- 新生儿喂养指导
- 2026盐城师范学院招聘专业技术人员34人(第一批)考试模拟试题及答案解析
- 2026吉林长春市吉林大学白求恩第一医院泌尿外二科招聘考试参考题库及答案解析
- 怀柔区怀北镇社区卫生服务中开招聘合同制1人考试备考试题及答案解析
- 2026中国建筑一局(集团)有限公司法律事务管理岗招聘1人考试备考题库及答案解析
- 2026四川德阳市什邡市教育和体育局选调高(职)中教师13人备考题库附答案详解
- 2026江西赣州市安远县东江水务集团有限公司第一批人员招聘10人备考题库含答案详解(b卷)
- 企业一般固废管理制度
- 2026年花样滑冰赛事品牌建设与营销创新案例研究
- 2026山东青岛海关缉私局警务辅助人员招聘10人考试参考题库及答案解析
- 2026年考研数学一模拟单套试卷(含解析)
- 旅馆防偷拍工作制度
- 《2020室性心律失常中国专家共识(2016共识升级版)》要点
- 人教A版(2019)高中数学必修第二册 基本立体图形 第2课时圆柱、圆锥、圆台、球与简单组合体的结构特征课件
- 国家开放大学《四史通讲》形考任务专题1-6自测练习参考答案
- 混凝土机械建筑施工机械
评论
0/150
提交评论