Print Page | Close Window

CommandBarComboBox.Text problem in 9.80

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=3104
Printed Date: 06 October 2024 at 12:28am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CommandBarComboBox.Text problem in 9.80
Posted By: dajv
Subject: CommandBarComboBox.Text problem in 9.80
Date Posted: 27 October 2005 at 12:36am
I get the error "Method 'Text' of object 'ICommandBarComboBox' failed" when I use CommandBarComboBox.Text.

e.g. ComboControl.Text = ""

I never had this problem with versions prior to 9.80. Is this a known problem? Let me know if you need me to reproduce it in a small app, but I haven't changed anything since it was working in a previous version.



Replies:
Posted By: Oleg
Date Posted: 27 October 2005 at 8:02am
Sorry, we can't reproduce it, please attach small sample.

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: dajv
Date Posted: 27 October 2005 at 6:16pm
I just tried to reproduce it but with no success. it a small project it works fine.

I never had this error before. Why might method 'Text' of object 'ICommandBarComboBox' fail?


Posted By: dajv
Date Posted: 27 October 2005 at 6:28pm
Actually I was able to reproduce it. I discovered it is a problem when using designerbars.

uploads/dajv/2005-10-27_182821_reproduce.zip - 2005-10-27_182821_reproduce.zip


Posted By: Oleg
Date Posted: 28 October 2005 at 6:43am

Instead

CommandBars1.DesignerControls.Find

you must use

CommandBars1.FindControl

And DropDownListStyle must be  True to set text.

 



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: dajv
Date Posted: 30 October 2005 at 4:49pm
oleg the Designer Bars have been saved with the combobox DropDownStyle set to DropDownList. Using FindControl does retrieve the control but commandbarcombobox.Text = "bye" doesn't have any effect.

Looking at the commandbarcombobox object in Command5_Click() once the FindControl line executes, the .DropDownListStyle property is set to False. This should be set to True because the control in the DesignerBars has been set to DropDownListStyle.


Posted By: Oleg
Date Posted: 31 October 2005 at 2:00am

It is correct that commandbarcombobox.Text = "bye" doesn't have any effect.

because it has no editable part.

you must use ListIndex to change text:

commandbarcombobox.ListIndex = 1

commandbarcombobox.ListIndex = commandbarcombobox.FindItem("bye")



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: dajv
Date Posted: 02 November 2005 at 4:02pm
I never had to use CommandBars.FindControl to do it before, but it works now.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net