精华内容
下载资源
问答
  • VB程序,如果你用如下语句动态创建一个Combo控件 Dim WithEvents cmbDropList As ComboBox ... Set cmbDropList = Controls.Add("VB.ComboBox", "cmbDropList") 后,Combo控件的Style值是1 (VbComboDropDown ...

    在VB程序中,如果你用如下语句动态创建一个Combo控件
      Dim WithEvents cmbDropList As ComboBox

      ...
      Set cmbDropList = Controls.Add("VB.ComboBox", "cmbDropList")

      后,Combo控件的Style值是1 (VbComboDropDown 下拉式组合框,包括一个下拉式列表和一个文本框。可以从列表选择或在文本框中输入
    ),若想把Style的值更改2 (VbComboDrop-DownList 2 下拉式列表。这种样式仅允许从下拉式列表中选择 )

      通过语句Combo1.Style=2是不行的,因为Style是只读属性。为了突破这个限制,我动用的Spy++这个武器,对两种不同Style值的combo控件进行侦察,发现了两处不同

      1、combo控件的style的值为1-VbComboDropDown时,combo控件窗口的Styles=&H54010242,而combo控件的style的值为2-VbComboDrop-DownList时,combo控件窗口的Styles=&H54010243

      2、combo控件的style的值为1-VbComboDropDown时,combo控件里有一个Edit文本框窗口,而combo控件的style的值为2-VbComboDrop-DownList时,则没有Edit文本框窗口

      我首先试着用API函数改变combo控件窗口的Styles值,
      Call SetWindowLong(Combo1.hwnd,
    GWL_STYLE,&H54010243)
      看Combo控件有没有什么改变,结果大失所望,

      我再次试着用API函数杀死Combo控件里的那个Edit窗口,耶~~~,成功了
      下面是我的实现代码:
      Private
    Const GWL_STYLE = (-16)
      Private Const GW_CHILD = 5
      Private Declare
    Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long

      Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA"
    (ByVal hwnd As Long, ByVal nIndex As Long) As Long
      Private Declare
    Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long,
    ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
      Private Declare
    Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As
    Long
      Private Declare Function DestroyWindow Lib "user32" (ByVal hwnd As
    Long) As Long
      Private Declare Function CreateWindowEx Lib "user32" Alias
    "CreateWindowExA" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal
    lpWindowName As String, ByVal dwStyle As Long, ByVal x As Long, ByVal y As Long,
    ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, ByVal
    hMenu As Long, ByVal hInstance As Long, lpParam As Any) As Long
      Const
    SW_HIDE = 0
      Const SW_SHOW = 5
      Dim WithEvents cmbDropList As ComboBox

      Private Sub cmbDropList_Click()
      MsgBox cmbDropList.Text
      End
    Sub
      Private Sub Command1_Click()
      Dim ChildHwnd As Long
      Set
    cmbDropList = Controls.Add("VB.ComboBox", "cmbDropList")

      cmbDropList.Visible = True
      cmbDropList.AddItem "One"

      cmbDropList.AddItem "Two"
      ChildHwnd = GetWindow(cmbDropList.hwnd,
    GW_CHILD) '取edit句柄
      Call DestroyWindow(ChildHwnd) 'Kill edit窗口

      '改变cmbDropList的Style,这一语句可有可无~~~~,
      Call
    SetWindowLong(cmbDropList.hwnd, GWL_STYLE, GetWindowLong(cmbDropList.hwnd,
    GWL_STYLE) + 1)
      End Sub

    转载于:https://www.cnblogs.com/Spacecup/p/3564845.html

    展开全文
  • VB程序,通过代码改变Combo控件只读属性Style值 (转)[@more@] 在VB程序,如果你用如下语句动态创建一个Combo控件 Dim WithEvents cmbDropList As ComboBox....
    在VB程序中,通过代码改变Combo控件只读属性Style值 (转)[@more@]

     

    在VB程序中,如果你用如下语句动态创建一个Combo控件

    Dim WithEvents cmbDropList As ComboBox
    ...
    Set cmbDropList = Controls.Add("VB.ComboBox", "cmbDropList")
    后,Combo控件的Style值是1 (VbComboDropDown 下拉式组合框,包括一个下拉式列表和一个文本框。可以从列表选择或在文本框中输入 ),若想把Style的值更改2 (VbComboDrop-DownList 2 下拉式列表。这种样式仅允许从下拉式列表中选择 )

    通过语句Combo1.Style=2是不行的,因为Style是只读属性。为了突破这个限制,我动用的Spy++这个武器,对两种不同Style值的combo控件进行侦察,发现了两处不同

      1、combo控件的style的值为1-VbComboDropDown时,combo控件窗口的Styles=&H54010242,而combo控件的style的值为2-VbComboDrop-DownList时,combo控件窗口的Styles=&H54010243

      2、combo控件的style的值为1-VbComboDropDown时,combo控件里有一个Edit文本框窗口,而combo控件的style的值为2-VbComboDrop-DownList时,则没有Edit文本框窗口

    我首先试着用api函数改变combo控件窗口的Styles值,

    Call SetWindowLong(Combo1.hwnd, GWL_STYLE,&H54010243)

    看Combo控件有没有什么改变,结果大失所望,

    我再次试着用API函数杀死Combo控件里的那个Edit窗口,耶~~~,成功了

    下面是我的实现代码:

    Private Const GWL_STYLE = (-16)
    Private Const GW_CHILD = 5

    Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
    Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
    Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
    Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
    Private Declare Function DestroyWindow Lib "user32" (ByVal hwnd As Long) As Long
    Private Declare Function CreateWindowEx Lib "user32" Alias "CreateWindowExA" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, ByVal hMenu As Long, ByVal hInstance As Long, lpParam As Any) As Long

    Const SW_Hide = 0
    Const SW_SHOW = 5

    Dim WithEvents cmbDropList As ComboBox

    Private Sub cmbDropList_Click()
      MsgBox cmbDropList.Text
    End Sub

    Private Sub Command1_Click()
      Dim ChildHwnd As Long
     
      Set cmbDropList = Controls.Add("VB.ComboBox", "cmbDropList")
     
      cmbDropList.Visible = True
      cmbDropList.AddItem "One"
      cmbDropList.AddItem "Two"
     
      ChildHwnd = GetWindow(cmbDropList.hwnd, GW_CHILD)  '取edit句柄
      Call DestroyWindow(ChildHwnd)                      'Kill edit窗口
      '改变cmbDropList的Style,这一语句可有可无~~~~,
      Call SetWindowLong(cmbDropList.hwnd, GWL_STYLE, GetWindowLong(cmbDropList.hwnd, GWL_STYLE) + 1)

    End Sub


    来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10752043/viewspace-990513/,如需转载,请注明出处,否则将追究法律责任。

    转载于:http://blog.itpub.net/10752043/viewspace-990513/

    展开全文
  • 这种样式仅允许从下拉式列表选择 ) 通过语句 Combo 1. Style =2是不行的,因为 Style 是只读属性。为了突破这个限制,我动用的Spy++这个武器,对两种不同 Style 值的 Combo 控件进行侦察,发现了两处不同  1、 ...
    
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
    <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>

     

    VB程序中,如果你用如下语句动态创建一个Combo控件

    Dim WithEvents cmbDropList As ComboBox
    ...
    Set cmbDropList = Controls.Add("VB.ComboBox", "cmbDropList")
    后,Combo控件的Style值是1 VBComboDropDown 下拉式组合框,包括一个下拉式列表和一个文本框。可以从列表选择或在文本框中输入 ),若想把Style的值更改2 (VBComboDrop-DownList 2 下拉式列表。这种样式仅允许从下拉式列表中选择 )

    通过语句Combo1.Style=2是不行的,因为Style是只读属性。为了突破这个限制,我动用的Spy++这个武器,对两种不同Style值的Combo控件进行侦察,发现了两处不同

        1、Combo控件的Style的值为1-VBComboDropDown时,Combo控件窗口的Styles=&H54010242,而Combo控件的Style的值为2-VBComboDrop-DownList时,Combo控件窗口的Styles=&H54010243

        2、Combo控件的Style的值为1-VBComboDropDown时,Combo控件里有一个Edit文本框窗口,而Combo控件的Style的值为2-VBComboDrop-DownList时,则没有Edit文本框窗口

    我首先试着用API函数改变Combo控件窗口的Styles值,

    Call SetWindowLong(Combo1.hwnd, GWL_Style,&H54010243)

    Combo控件有没有什么改变,结果大失所望,

    我再次试着用API函数杀死Combo控件里的那个Edit窗口,耶~~~,成功了

    下面是我的实现代码:

    Private Const GWL_Style = (-16)
    Private Const GW_CHILD = 5

    Private Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
    Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
    Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
    Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
    Private Declare Function DestroyWindow Lib "user32" (ByVal hwnd As Long) As Long
    Private Declare Function CreateWindowEx Lib "user32" Alias "CreateWindowExA" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, ByVal hMenu As Long, ByVal hInstance As Long, lpParam As Any) As Long

    Const SW_HIDE = 0
    Const SW_SHOW = 5

    Dim WithEvents cmbDropList As ComboBox

    Private Sub cmbDropList_Click()
      MsgBox cmbDropList.Text
    End Sub

    Private Sub Command1_Click()
      Dim ChildHwnd As Long
     
      Set cmbDropList = Controls.Add("VB.ComboBox", "cmbDropList")
     
      cmbDropList.Visible = True
      cmbDropList.AddItem "One"
      cmbDropList.AddItem "Two"
     
      ChildHwnd = GetWindow(cmbDropList.hwnd, GW_CHILD)  '取edit句柄
      Call DestroyWindow(ChildHwnd)                      'Kill edit窗口
      '改变cmbDropList的Style,这一语句可有可无~~~~,
      Call SetWindowLong(cmbDropList.hwnd, GWL_Style, GetWindowLong(cmbDropList.hwnd, GWL_Style) + 1)

    End Sub

    <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
    <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
    展开全文
  • vb6,border style 的1-fixed single 和 3-fixed dialog有什么区别? 谢谢大家。
  • VB中的数据类型

    2011-08-12 14:44:00
    p style="text-indent:2em"&gt;&lt;/p&gt; &lt;p style="text-indent:2em"&gt;&lt;span style="font-size:16px"&gt;&lt;strong&gt;1.Boolean ...
    <wbr><p style="text-indent:2em"></p>
    <p style="text-indent:2em"><span style="font-size:16px"><strong>1.Boolean 布尔型,这种类型,只有真、假(即true or false)两个值,它占用两个字节。</strong></span></p>
    <p style="text-indent:2em"><span style="font-size:16px"><strong>2.Byte 字节型 他占用一个字节,他的范围是0—255</strong></span></p>
    <p style="text-indent:2em"><span style="font-size:16px"><strong>3.Integer 整型 它占用两个字节,通常用%来表示 ,例a%;它占用2个字节(C语言中为4个字节),它的范围是0----32768/32767</strong></span></p>
    <p style="text-indent:2em"><span style="font-size:16px"><strong>4.Long 长整型 它占用4个字节,它的简写符号是&amp;,它的范围是-2147483648到2147483647。</strong></span></p>
    <p style="text-indent:2em"><span style="font-size:16px"><strong>对于整型和长整型,我们通常会选用长整型,尽管长整型比较大,但是相对于整型会比较快,因为CPU一般是32位的,长整型可以一次把数据存储到寄存器里或CPU里面,还有长整型的兼容性比较好。</strong></span></p>
    <p style="text-indent:2em"><span style="font-size:16px"><strong>5.Single 单精度浮点 4个字节。范围比较大,但是精度很小,在科学计算时,不用改精度 ,它的符号是!</strong></span></p>
    <p style="text-indent:2em"><span style="font-size:16px"><strong>6.double 双精度浮点 8个字节,符号式#,它的精度远远大于单精度浮点。</strong></span></p>
    <p style="text-indent:2em"><span style="font-size:16px"><strong>7.String 字符串 a.可变长字符串,用于读取文件,文本查找等。</strong></span></p>
    <p style="text-indent:2em"><span style="font-size:16px"><strong> B.定长字符长</strong></span></p>
    <p style="text-indent:2em"><span style="font-size:16px"><strong>8.Date 日期 形式是 #…………#,如20011年11月11日可表示为 #2011/11/11#</strong></span></p>
    <p style="text-indent:2em"><span style="font-size:16px"><strong>9. Currency @表示符</strong></span></p>
    <p style="text-indent:2em"><span style="font-size:16px"><strong>10. User Defined </strong>
    </span></p>
    <p style="text-indent:2em"><span style="font-size:16px"><strong>11.Variant 可变类型 在VB下,变量可以不声明,不同于以上类型,赋值后,可以对他进行其他类型的赋值,例如原先是一个字符串,后来再给他赋为日期。Variant类型的格式:</strong></span></p>
    <table border="1" cellspacing="0" cellpadding="0"><tbody><tr>
    <td valign="top" width="284">
    <p style="text-indent:2em"><strong>类型变量(如整型)</strong></p>
    </td>
    <td valign="top" width="284">
    <p style="text-indent:2em"><strong>相应数据、地址</strong></p>
    </td>
    </tr></tbody></table>
    <p style="text-indent:2em"><span style="font-size:16px"><strong> Variant的缺点是占用内存较大,速度慢;方便之处是使用灵活</strong></span></p>
    <p style="text-indent:2em"><span style="font-size:16px"><strong> VB中的数据类型并不是孤立的,他们之间可以用转换函数来相互转换。</strong></span></p>
    <p style="text-indent:2em"><span style="font-size:16px"><strong></strong></span></p>
    
    </wbr>
    展开全文
  • 想用VB实现图上按钮的自动点击,实际,鼠标移动有字的按钮上点击,就可以执行相应的程序。已取得网页源代码,但没有“input"、也没有”button",不知道该怎么,请教大佬们。 网页代码如下: ``` <HEAD><TITLE...
  • 学生信息管理系统,有这样一条代码 [vb]view plaincopyprint? <spanstyle="font-family:KaiTi_GB2312;font-size:18px;"><strong>txtSQL="select*fromstudent_InfowhereClass_No='"&...
  • vb.net如何快速绘制鼠标移动轨迹

    千次阅读 热门讨论 2006-12-13 10:32:00
    vb.net如何在picturebox上绘制直线,且绘制鼠标移动轨迹 主要代码及注释如下: (){this.style.display=none; document.getElementById(_7_2242_Open_Text).style.di
  • VB中无边框窗体实现弹出菜单

    千次阅读 2005-01-17 12:24:00
    说来也简单1、设定窗体属性: A、BorderStyle属性设为0; B、ControlBox属性设为False。(这一点很重要,不然插入菜单后会出现边框)2、编辑菜单 利用菜单编辑器编辑弹出菜单(例:加S1为一级菜单,它的可见属性...
  • PrivateaAsDouble PrivateSubCombo1_Click() '1位小数,系数用10 a=Combo1.ItemData(Combo1.ListIndex)/10 MsgBoxa,32 ...'设置时,把Combo1的Style属性设置为2 PrivateSubForm_Load() ...
  • span style="font-size:24px"&gt;&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-size:24px"&gt;&lt;/span&gt;&lt;/p&gt; &...
  • ", vbYesNoCancel + vbExclamation, "VB 保存数据到 Excel") If X = 6 Then '单击“是”则保存 Set ExcelApp = CreateObject("Excel.Application") ExcelApp.Workbooks.Add With ExcelApp.ActiveSheet ....
  • VB 控件

    2015-06-24 19:09:00
    form 窗口 MSHFlexGrid控件 maxbutton 最大化 显示不显示 表格边框颜色值 GridColor minbutton 最小化 显示...表格的字的颜色 ForeColor borderstyle 值2 最大化最小化显示 标题颜色 For...
  • 在网页编程,想用按钮实现一个弹出菜单,但是普通状态下的按钮不透明,无法显示菜单的背景,很是不美观,可以用下面的方法来使按钮透明,其实其它控件也能用这个方法实现透明效果 .tm { background-color:transparent;...
  • VB.NETLISTVIEW排序(原创)

    千次阅读 2005-10-13 12:01:00
    控件:TEXTBOX :1个 Name:txtJobNoBUTTON: 2个 Name:btnFilter,btnShowAllLISTVIEW : 1个 Name:lstvwJobNo Columns:JobNo,ContainerID,CartonID,PO,Style,Color,Size,ShipMent,Factory 
  • 使用VB6创建工具栏,如果使用了工具栏向导,它会把你已经设置好的工具栏按钮Style 属性值为3-tbrSeparator 的Key属性清空,解决办法是用4-PlaceHolder代替 3-tbrSeparator,获得相同的运行时外观效果,并且不会在...
  • 回想第一次敲机房收费。自己调用了api函数实现了父窗口及其子窗口最小化的功能。...先看看在vb.net怎样调用: 首先加入一个类模块,来封装此API函数: <span style="font-size:14px;"> Public De...
  • 回想第一次敲房费,他说自己是api函数实现父窗口...事实上细致看两者并没有多大的差别,先看看在vb.net怎样调用: 首先加入一个类模块。来封装此API函数: <span style="font-size:14px;"> Public Decla...
  • 回顾第一次敲机房收费,自己调用了api函数实现了父窗体及其子窗体...其实仔细看两者并没有多大的区别,先看看在vb.net如何调用: 首先添加一个类模块,来封装此API函数: <span style="font-size:14px;"> P...
  • 我用单个窗体的多实例构建一个 ...strong style="border: 0px none ; color: rgb(0, 0, 255); font-weight: normal; text-decoration: underline;" onmouseover='isShowAds = true;isShowAds2 = true;Key...
  • VB 禁止调整MDI窗体大小,窗体文件一共是2个,一个是主窗口文件,一个是MDI窗口文件,实现禁止改变窗口大小的功能,我们可以在MDIForm当窗体加载时,,执行以下代码:  Private Sub MDIForm_Load()  Style = ...
  • 可以在设计阶段或运行期间在这个区域输入、编辑、修改和显示文本,类似于一个简单的文本编辑器。l-常用属性文本框基本属性:Name、text、:Height、Width、Top、Left、Enabled、Visible、FontName、FontSize、...

空空如也

空空如也

1 2 3 4 5 ... 7
收藏数 127
精华内容 50
关键字:

vb中style