PC Review


Reply
Thread Tools Rate Thread

ComboBox SelectedIndex Property Changes when changing Visible property

 
 
mike
Guest
Posts: n/a
 
      20th Oct 2003
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
 
Reply With Quote
 
 
 
 
Craig Vick [MSFT]
Guest
Posts: n/a
 
      24th Oct 2003
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
>


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ToolStrip keeps changing its visible property to False Daniel Jeffrey Microsoft C# .NET 5 3rd Oct 2007 01:39 AM
Changing Visible property in Form changes location. Doc John Microsoft C# .NET 8 10th Jul 2007 12:35 PM
Re: Changing subform .visible property to true from a control on the m Douglas J. Steele Microsoft Access Form Coding 1 10th Jan 2007 07:30 PM
property with defalut value will not be called in auto-generated code, and how to make a property only visible at design time? Ryan Liu Microsoft C# .NET 2 27th Aug 2006 03:09 PM
ComboBox's SelectedIndex Property problem Eric A. Johnson Microsoft VB .NET 8 19th Oct 2005 04:22 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:49 AM.