KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

ComboBox DoubleClick not working

 
Post new topic   Reply to topic    KiXforms Forum Index -> KiXforms.NET Discussion
View previous topic :: View next topic  
Author Message
rjdegraff
KiXforms Dabbler
KiXforms Dabbler


Joined: 12 Sep 2007
Posts: 8
Location: Winnipeg, Manitoba, Canada

PostPosted: Wed Sep 12, 2007 2:15 pm    Post subject: ComboBox DoubleClick not working Reply with quote

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
View user's profile Send private message
pearly
KiXforms Aficionado
KiXforms Aficionado


Joined: 27 Jan 2004
Posts: 332

PostPosted: Wed Sep 12, 2007 4:33 pm    Post subject: Reply with quote

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
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Wed Sep 12, 2007 5:31 pm    Post subject: Reply with quote

Will have a look.
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Wed Sep 12, 2007 5:37 pm    Post subject: Reply with quote

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
View user's profile Send private message
pearly
KiXforms Aficionado
KiXforms Aficionado


Joined: 27 Jan 2004
Posts: 332

PostPosted: Wed Sep 12, 2007 5:47 pm    Post subject: Reply with quote

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
View user's profile Send private message
rjdegraff
KiXforms Dabbler
KiXforms Dabbler


Joined: 12 Sep 2007
Posts: 8
Location: Winnipeg, Manitoba, Canada

PostPosted: Fri Nov 09, 2007 4:28 pm    Post subject: Reply with quote

Actually, it was a requirement because at the time I didn't realize I was using the wrong control Stupid
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> KiXforms.NET Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group