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" <(E-Mail Removed)>
>Sender: "mike" <(E-Mail Removed)>
>Subject: ComboBox SelectedIndex Property Changes when changing Visible
property
>Date: Mon, 20 Oct 2003 06:17:46 -0700
>Lines: 19
>Message-ID: <052101c3970c$8d684b10$(E-Mail Removed)>
>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
>
|