470,591 Members | 1,589 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,591 developers. It's quick & easy.

ComboBox SelectedIndex Property Changes when changing Visible property

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
1 2197
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.

Similar topics

2 posts views Thread by pei_world | last post: by
2 posts views Thread by Kalvin | last post: by
5 posts views Thread by Eric A. Johnson | last post: by
1 post views Thread by fiaolle | last post: by
6 posts views Thread by tbrown | last post: by
3 posts views Thread by Simon Tamman | last post: by
1 post views Thread by Andrus | last post: by
5 posts views Thread by Kevinp | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.