473,395 Members | 1,696 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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 2386
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Oliver Hoehle | last post by:
Hello! This ist the source-code for an editable combobox implemented with HTML,CSS and Javascript. I have tested it with IE and Mozilla. But I don't know, if it will work in other browsers...
2
by: pei_world | last post by:
I want to implement a key hit with enter to dropdown a combobox that is in the datagrid. in this case I need to override its original behaviours. I found some codes from the web. Does anyone know...
2
by: Kalvin | last post by:
I found some code in Google, don't remember where, for an AutoComplete combobox. Everything is great with it except for one thing. If I use the mouse to drop the list down, then start typing to...
5
by: Eric A. Johnson | last post by:
Hi Everyone, I am at my wit's end here. I have a combobox (combyQueryTitle) that I need to use in order to select a query for my database project. Therefore, I am using the...
1
by: fiaolle | last post by:
Hi The first set of source code is the class for a combobox in a grid, hopefully. In the second set of code we try to use the combobox class, but the grid is empty. I don't understand how this...
6
by: tbrown | last post by:
I have a combobox with items like this: {one,two,three}. The selected index is 0, so "one" appears in the combobox text. When the user drops down the list, and selects "two", for example, I...
3
by: Simon Tamman | last post by:
I've come across an interesting bug. I have workarounds but i'd like to know the root of the problem. I've stripped it down into a short file and hope someone might have an idea about what's going...
1
by: Andrus | last post by:
I need to enter null value from combobox to business object property. My combobox datasource does not contain ValueMember with null value. So I tried to create combobox which stores null to bound...
5
by: Kevinp | last post by:
I've spent the last four hours Google searching for a way to disable items in a Combobox. I found one example in C++ which I can't get to work and another in C# that I couldn't get to work either....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.