473,397 Members | 2,084 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,397 software developers and data experts.

Inherited ComboBox broke from VS.Net 2002 to VS.Net 2003, what gives?

I have an inherited comboBox that I'm using to try to make an intellisense type box in VS 2003 .Net.

It works okay in VS.Net 2002. I can get it to do most of my stuff, but it's not keeping the SelectionStart and SelectionLength values I assign in my OnKeyPress event.

Here is a snippet of my code. The Application.DoEvents() funcs are just so I can see what's going on at various spots.

private void OnKeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) {
string _cmbText;
int selectionStart;
int selectionLength;
AutoComboBox _cmb = (AutoComboBox) sender;

if (_cmb.DropDownStyle == System.Windows.Forms.ComboBoxStyle.DropDown ||
_cmb.DropDownStyle == System.Windows.Forms.ComboBoxStyle.Simple) {

_cmbText = SearchList(_cmb); //this returns the Text at the index of the combobox from the FindText(string) func
if (_cmbText != String.Empty) {

selectionStart = _cmb.Text.Length;
selectionLength = _cmbText.Length - _cmb.Text.Length;

_cmb.SelectedIndex = _cmb.FindString(_cmbText);

_cmb.SelectionStart = selectionStart;
_cmb.SelectionLength = selectionLength;

e.Handled = true;
}
}
}
Nov 16 '05 #1
0 996

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: Noesis Strategy | last post by:
When I ordered my new laptop, Sony didn't offer Access 2003 in its bundles. Recently, I have begun to design Access databases using an copy of Access 2002 from my previous laptop. It works fine,...
0
by: Lee Moody | last post by:
I've recently upgraded to VS.NET 2003. I had written routines to implement an autoselect for a combobox in my VB.NET 2002 program. In VB.NET 2002 it worked fine. In 2003 it stopped working at...
14
by: Graham Blandford | last post by:
Hi there, A quickie I think... If I create a new class that inherits the values of a windows form component class, can there ever be a visual representation of this in the .Net IDE? E.g. if...
2
by: SKarnis | last post by:
We are trying to rebuild a current Access 2002 (XP) mdb program to VB.NET with a SQL database - we are having problems with a suitable combobox. There are many threads discussing multiple column...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.