By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,153 Members | 995 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,153 IT Pros & Developers. It's quick & easy.

ComboBox SelectedIndex Property Changes when changing Visible property

P: n/a
Hi,

I'd like advice from a .NETer. I have a loadcombo
routine which sets the selectedindex to -1 if it's an "add
record", but then it goes to a security routine which,
based on permissions sets the visible property. When the
visible property is set..

'Petition Type
lblPetitionType.Visible = False
cboPetitionType.Visible = True

... and after this line of code then it sets the
selectedindex to 0. Why does it do this, and how can I
stop it without rearranging all of my code.

Thanks for your help.

Mike
Nov 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi Mike,

In a simple app (with a ComboBox and a Button) I'm not able to repro what
you're seeing. Once I set SelectedIndex to -1, it stays -1.

Craig
VB.NET Team

--------------------------------------------------------------------
This reply is provided AS IS, without warranty (express or implied).
--------------------
Content-Class: urn:content-classes:message
From: "mike" <an*******@discussions.microsoft.com>
Sender: "mike" <an*******@discussions.microsoft.com>
Subject: ComboBox SelectedIndex Property Changes when changing Visible propertyDate: Mon, 20 Oct 2003 06:17:46 -0700
Lines: 19
Message-ID: <05****************************@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Thread-Index: AcOXDI1oOJTTUOR2R3KApMZuy7ft1A==
Newsgroups: microsoft.public.dotnet.languages.vb
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:148373
NNTP-Posting-Host: TK2MSFTNGXA08 10.40.1.160
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

Hi,

I'd like advice from a .NETer. I have a loadcombo
routine which sets the selectedindex to -1 if it's an "add
record", but then it goes to a security routine which,
based on permissions sets the visible property. When the
visible property is set..

'Petition Type
lblPetitionType.Visible = False
cboPetitionType.Visible = True

.. and after this line of code then it sets the
selectedindex to 0. Why does it do this, and how can I
stop it without rearranging all of my code.

Thanks for your help.

Mike


Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.