View previous topic :: View next topic |
Author |
Message |
rjdegraff KiXforms Dabbler

Joined: 12 Sep 2007 Posts: 8 Location: Winnipeg, Manitoba, Canada
|
Posted: Wed Sep 12, 2007 2:15 pm Post subject: ComboBox DoubleClick not working |
|
|
I have an application that I am porting from an HTA to VBS with kixforms (.net). It requires a combobox that responds to a double click. The following code does not get a response to that event? Is this a bug?
Dim System
Set System = CreateObject("KiXforms.System")
Dim Form1
Set Form1 = System.Form
Form1.Text = "Form1"
Dim ComboBox1
Set ComboBox1 = Form1.Controls.Add(System.ComboBox)
ComboBox1.Location = System.Point(88, 57)
ComboBox1.DropDownStyle = 0
ComboBox1.TabIndex = 0
ComboBox1.Size = System.Size(121, 150)
ComboBox1.DoubleClick = "ComboBox1DoubleClick( ComboBox1 )"
Form1.Visible = "True"
Do While Form1.Visible
Execute(Form1.DoEvents)
Loop
Function ComboBox1DoubleClick( Object )
MsgBox "double click"
End Function |
|
Back to top |
|
 |
pearly KiXforms Aficionado


Joined: 27 Jan 2004 Posts: 332
|
Posted: Wed Sep 12, 2007 4:33 pm Post subject: |
|
|
I have verified it doesn't work when converted to KiXtart and it also doesn't work in all combobox dropdownstyles.
Code: |
$System = CreateObject("Kixforms.System")
$frmMain = $System.Form
$cbo1 = $frmMain.Controls.Add($System.ComboBox)
$cbo1.Location = $System.Point(88,57)
$cbo1.DropDownStyle = $System.ComboBoxStyle_Simple
$cbo1.Size = $System.Size(121,150)
$cbo1.DoubleClick = 'cbo1DoubleClick($$cbo1)'
$ = $cbo1.Items.Add("a")
$ = $cbo1.Items.Add("b")
$ = $cbo1.Items.Add("c")
$frmMain.Visible = 1
Do While $frmMain.Visible
$ = Execute($frmMain.DoEvents)
Loop
Exit 0
Function cbo1DoubleClick($obj)
? "works"
EndFunction
|
Shawn?? |
|
Back to top |
|
 |
Shawn KiXforms Developer


Joined: 22 Feb 2003 Posts: 1983 Location: Canada
|
Posted: Wed Sep 12, 2007 5:31 pm Post subject: |
|
|
Will have a look. |
|
Back to top |
|
 |
Shawn KiXforms Developer


Joined: 22 Feb 2003 Posts: 1983 Location: Canada
|
Posted: Wed Sep 12, 2007 5:37 pm Post subject: |
|
|
According to Microsoft, the ComboBox does not support the DoubleClick event ... here is the link:
http://msdn2.microsoft.com/en-us/library/system.windows.forms.combobox.doubleclick.aspx
Further down it says:
This event is not relevant for this class.
Doesn't surprise me. You may ask "then why is double-click even listed" thats because the ComboBox derives from Control which has the generic double-click event. .Net classes do that much - override a base class method then "nerf" it. |
|
Back to top |
|
 |
pearly KiXforms Aficionado


Joined: 27 Jan 2004 Posts: 332
|
Posted: Wed Sep 12, 2007 5:47 pm Post subject: |
|
|
Yeah I thought it was weird for a combobox to support a DoubleClick and I know it derives most of the properties and methods from Control class. I wonder why it was a requirement for rjdegraff.
Can you shed some light, rjdegraff? |
|
Back to top |
|
 |
rjdegraff KiXforms Dabbler

Joined: 12 Sep 2007 Posts: 8 Location: Winnipeg, Manitoba, Canada
|
Posted: Fri Nov 09, 2007 4:28 pm Post subject: |
|
|
Actually, it was a requirement because at the time I didn't realize I was using the wrong control  |
|
Back to top |
|
 |
|