[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

mm

6/30/2012 4:13:00 AM

It seems to be a bug of the ComboBox when changing the ListIndex from its
Change event procedure.

If you want to test this, please add a combo and a command button to a new
project, paste the code, run and type 'b' in the combo, then click the
command button.

Private Sub Form_Load()
Combo1.AddItem "aaaaaaaaa"
Combo1.AddItem "bbbbbbbb"
Combo1.AddItem "ccccccccc"
End Sub

Private Sub Combo1_Change()
If Combo1.Text = "b" Then
Combo1.ListIndex = 1
End If
End Sub

Private Sub Command1_Click()
MsgBox Combo1.ListIndex
End Sub



38 Answers

(Mike Mitchell)

6/30/2012 7:26:00 AM

0

On Sat, 30 Jun 2012 01:12:49 -0300, "Eduardo" <mm@mm.com> wrote:

>It seems to be a bug of the ComboBox when changing the ListIndex from its
>Change event procedure.
>
>If you want to test this, please add a combo and a command button to a new
>project, paste the code, run and type 'b' in the combo, then click the
>command button.
>
>Private Sub Form_Load()
> Combo1.AddItem "aaaaaaaaa"
> Combo1.AddItem "bbbbbbbb"
> Combo1.AddItem "ccccccccc"
>End Sub
>
>Private Sub Combo1_Change()
> If Combo1.Text = "b" Then
> Combo1.ListIndex = 1
> End If
>End Sub
>
>Private Sub Command1_Click()
> MsgBox Combo1.ListIndex
>End Sub

From the Help file:

"Setting

-1

(Default for ComboBox, DirListBox, and DriveListBox controls)
Indicates no item is currently selected. For a ComboBox control,
indicates the user has entered new text into the text box portion."

MM

mm

6/30/2012 9:02:00 AM

0


"MM" <kylix_is@yahoo.co.uk> escribió en el mensaje
news:9fatu7hq9b1mtpmelt6c76get8u09fqe21@4ax.com...

> From the Help file:
>
> "Setting
>
> -1
>
> (Default for ComboBox, DirListBox, and DriveListBox controls)
> Indicates no item is currently selected. For a ComboBox control,
> indicates the user has entered new text into the text box portion."

It seems to be by design then. By I still would think that the -1 should be
set before entering the Change event and not after.


Ralph

6/30/2012 4:50:00 PM

0

On Sat, 30 Jun 2012 06:01:32 -0300, "Eduardo" <mm@mm.com> wrote:

>
>"MM" <kylix_is@yahoo.co.uk> escribió en el mensaje
>news:9fatu7hq9b1mtpmelt6c76get8u09fqe21@4ax.com...
>
>> From the Help file:
>>
>> "Setting
>>
>> -1
>>
>> (Default for ComboBox, DirListBox, and DriveListBox controls)
>> Indicates no item is currently selected. For a ComboBox control,
>> indicates the user has entered new text into the text box portion."
>
>It seems to be by design then. By I still would think that the -1 should be
>set before entering the Change event and not after.
>

Expect to be surprised on occasion by the ComboBox whenever you assume
it as being a 'single' object, as the name is more descriptive than it
might appear - the ComboBox is a wrap (a combination) of two separate
objects.

The idiosyncrasies of the ComboBox is well documented online.

Also be aware that the behavior of a ComboBox is affected by property
settings such as Style.

-ralph

mm

7/1/2012 1:05:00 AM

0


"ralph" <nt_consulting64@yahoo.com> escribió en el mensaje
news:ct9uu7t5hh2fmockbln4u6381fhe5ij5ua@4ax.com...

> Expect to be surprised on occasion by the ComboBox whenever you assume
> it as being a 'single' object, as the name is more descriptive than it
> might appear - the ComboBox is a wrap (a combination) of two separate
> objects.

Yes, it's a textbox and a listbox, I think. Hence the name "combo".


unknown

7/2/2012 8:22:00 PM

0

"Eduardo" <mm@mm.com> wrote in message
news:jslubn$o0e$1@speranza.aioe.org...
> It seems to be a bug of the ComboBox when changing the ListIndex from its
> Change event procedure.
>
> If you want to test this, please add a combo and a command button to a new
> project, paste the code, run and type 'b' in the combo, then click the
> command button.

That's normal. Try this:

Private Sub Combo1_Change()
Static bHere As Boolean

If bHere Then
Exit Sub
End If
bHere = True

If Combo1.Text = "b" Then
Combo1.ListIndex = 1
End If

bHere = False
End Sub



mm

7/3/2012 1:51:00 AM

0


"Farnsworth" <nospam@nospam.com> escribió en el mensaje
news:jssvu9$pn5$1@speranza.aioe.org...

> That's normal. Try this:
>
> Private Sub Combo1_Change()
> Static bHere As Boolean
>
> If bHere Then
> Exit Sub
> End If
> bHere = True
>
> If Combo1.Text = "b" Then
> Combo1.ListIndex = 1
> End If
>
> bHere = False
> End Sub

and???


Malcolm McLean

7/6/2014 4:45:00 PM

0

On Sunday, July 6, 2014 4:49:43 PM UTC+1, shel...@thevillages.net wrote:
>
> > Has the mother country ever actually recognised your unilateral
> > declaration of independence?
>
> Who cares? ....and de facto yes.
>
Yes, we declared war on them in 1812.
You can only declare war on a country you recognise. But in fact the
US had been recognised in the peace treaty which ended the war of
independence.

Recognition of a country is acknowledgement of the fact that it
has military control of its own territory and an effective
government. It's not a statement about the moral worth or
legitimacy of a country, though obviously spurious moves such as
declaring your own house to be a free and independent sovereign
state, thus not subject to taxes, are not recognised by responsible
governments.
>
> I have no idea what a "British High Commission" is (and am too lazy to
> look it up), but FOREIGN countries have EMBASSIES in Washington.
>
Canada has a British High Commission. They have the Queen, who doesn't
send ambassadors to herself.

The reality is that Britain cannot defend itself without US assistance,
so we rely heavily on US support. That means that British troops always
have to tag along whenever Uncle Sam decides to invade somewhere.
Vietnam was the only exception. OK, and yes, Grenada. Some Britons resent
this.

sheldonlg

7/6/2014 7:59:00 PM

0

On 7/6/2014 12:44 PM, malcolm.mclean5@btinternet.com wrote:
> The reality is that Britain cannot defend itself without US assistance,
> so we rely heavily on US support. That means that British troops always
> have to tag along whenever Uncle Sam decides to invade somewhere.
> Vietnam was the only exception. OK, and yes, Grenada. Some Britons resent
> this.

....at least it is not as much as the French do for saving their asses
twice in the last century.

I don't really know how Brits view the US, but the US people tend to
look on the Brits as "brothers and sisters".

--
Shelly

kamlet

7/6/2014 9:13:00 PM

0

In article <95f163c1-a6c6-48b1-8006-25f1136e7df1@googlegroups.com>,
<malcolm.mclean5@btinternet.com> wrote:
>
>The reality is that Britain cannot defend itself without US assistance,
>so we rely heavily on US support.



I don't recall US participation or assistance in the Falkland
Islands war.

--

ArtKamlet at a o l dot c o m Columbus OH K2PZH

henry.p.goodman

7/6/2014 9:25:00 PM

0

On Sunday, July 6, 2014 5:44:50 PM UTC+1, malcolm...@btinternet.com wrote:
> On Sunday, July 6, 2014 4:49:43 PM UTC+1, shel...@thevillages.net wrote:
>
> >
>
> > > Has the mother country ever actually recognised your unilateral
>
> > > declaration of independence?
>
> >
>
> > Who cares? ....and de facto yes.
>
> >
>
> Yes, we declared war on them in 1812.
>
> You can only declare war on a country you recognise. But in fact the
>
> US had been recognised in the peace treaty which ended the war of
>
> independence.
>
>
>
> Recognition of a country is acknowledgement of the fact that it
>
> has military control of its own territory and an effective
>
> government. It's not a statement about the moral worth or
>
> legitimacy of a country, though obviously spurious moves such as
>
> declaring your own house to be a free and independent sovereign
>
> state, thus not subject to taxes, are not recognised by responsible
>
> governments.
>
> >
>
> > I have no idea what a "British High Commission" is (and am too lazy to
>
> > look it up), but FOREIGN countries have EMBASSIES in Washington.
>
> >
>
> Canada has a British High Commission. They have the Queen, who doesn't
>
> send ambassadors to herself.
>
>
>
> The reality is that Britain cannot defend itself without US assistance,
>
> so we rely heavily on US support. That means that British troops always
>
> have to tag along whenever Uncle Sam decides to invade somewhere.
>
> Vietnam was the only exception. OK, and yes, Grenada. Some Britons resent
>
> this.

We liberated the Falklands without American assistance.
Henry Goodman