473,378 Members | 1,382 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,378 software developers and data experts.

Regarding ComboBox of VB6.0

akashazad
Hi Friends,
Question:- In my VB6.0 Form I have used a ComboBox and a ToolBar in which I have provided some buttons such as Add,Modify,Abort,Delete,Save,Print,Exit. and also provided shortcuts to these buttons such as Ctrl+A for Add,Ctrl+M for Modify ,Ctrl+B for Abort.Now the problem is when I Load the Form it is in Find Mode and the focus is on the ComboBox .Now to Add new entry I need to go to Add Mode which can be done in two ways .

1. By Clicking on to Add Button using a Mouse .
2. By pressing the Shortcut key(.i.e Ctrl+A)


Now when I do it using a Mouse the ListIndex of the ComboBox remains the same as it was in Find mode.

But when I use Shortcut to go to Add mode the ListIndex of ComboBox changes to the value whose text starts from A .(Similar thing is happening when I press Ctrl+M to enter Modify Mode i.e. the listindex of combobox changes to the value whose text starts from M)This should not happen list index should remain the same as it was in Find Mode.


For further information I havn't written any thing in KeyDown or KeyPress events of the ComboBox. and the code for these shortcuts is written in KeyDown event of Form.
Jan 28 '08 #1
6 3337
lotus18
866 512MB
Hi

Post your codes for the reference of our experts. : )

Rey Sean
Jan 28 '08 #2
debasisdas
8,127 Expert 4TB
May i know what exactly is the problem with the application and what you want to achieve .
Jan 28 '08 #3
Killer42
8,435 Expert 8TB
A couple of questions.

First, could you use different shortcut keys? Some of those are already significant. For instance, if you're in a text field (including the text part of a combo box) then Ctrl-A would do a "select all".

Second, do you have the form's KeyPreview function set to True, so it gets to see the keys first?

Third, in the KeyDown event procedure, are you cancelling the key after processing it?

Fourth, to be honest, I have no idea what you mean by "Find mode".
Jan 29 '08 #4
A couple of questions.

First, could you use different shortcut keys? Some of those are already significant. For instance, if you're in a text field (including the text part of a combo box) then Ctrl-A would do a "select all".

Second, do you have the form's KeyPreview function set to True, so it gets to see the keys first?

Third, in the KeyDown event procedure, are you cancelling the key after processing it?

Fourth, to be honest, I have no idea what you mean by "Find mode".
Hi THANKS for responding and Sorry for not being clear in asking the Question.

1. I can not use any other Shortcut key.

2. I have set the keypreview property to true

3. I dont know what do U mean by Cancelling of key in keydown event

4. Find mode is similar to Browse mode in which we can go through the record but can not make any change and to make any change i.e. to Add or to Modify any record U need to move to Add Mode or Modify Mode respectively (so that Controls on the Forms become editable which is not in case of Find Mode).I think now U will be able to understand What I mean by Find mode
Jan 29 '08 #5
A couple of questions.

First, could you use different shortcut keys? Some of those are already significant. For instance, if you're in a text field (including the text part of a combo box) then Ctrl-A would do a "select all".

Second, do you have the form's KeyPreview function set to True, so it gets to see the keys first?

Third, in the KeyDown event procedure, are you cancelling the key after processing it?

Fourth, to be honest, I have no idea what you mean by "Find mode".
Hi THANKS for responding and Sorry for not being clear in asking the Question.

1. I can not use any other Shortcut key.

2. I have set the keypreview property to true

3. I dont know what do U mean by Cancelling of key in keydown event

4. Find mode is similar to Browse mode in which we can go through the record but can not make any change and to make any change i.e. to Add or to Modify any record U need to move to Add Mode or Modify Mode respectively (so that Controls on the Forms become editable which is not in case of Find Mode).I think now U will be able to understand What I mean by Find mode
Jan 29 '08 #6
Killer42
8,435 Expert 8TB
Thanks, that explains a bit more.

In the KeyDown event, you get to see what key was pressed, before anything much is done with it. At that point, I believe if you clear the value of KeyCode, it will effectively "abort" the keypress. I mean, any further code (such as a control's Keypress event procedure) won't be notified of the action.

This may (not certain) prevent the problem of with the combobox moving to the "A" entry.

Try it, anyway, and see what happens.
Jan 29 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Mr. B | last post by:
Here's the situation... You've a combobox with Items already added. Say they look like this (or even lines of text): 10-00-232 10-00-256 10-01-006 10-01-213 10-02-200
7
by: Nicolae Fieraru | last post by:
Hi All, I am trying to change the rowsource of a combobox when I click on it. I played with many events, associated with the form and the combobox, but still haven't figured out what is the way...
8
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
1
by: anonymous | last post by:
I've been trying to put a them, please help me out. Here's the major parts of my code: public Form1() { DataSet myDataSet = new DataSet("myDataSet"); DataTable testTable = new...
3
by: TT (Tom Tempelaere) | last post by:
Hay there, I'm writing my own DataGridComboBoxColumn because .NET 1.1 does not have one (I hope .NET 2.0 supplies one). I based it on this article:...
0
by: myPosts | last post by:
Hi all, I am having problem at a time of using datagrid in c#.net. On currentcell change event of datagrid i am displaying one combobox and setting location of combobox depending on location...
6
by: dbuchanan | last post by:
VS2005 I've been reading all the help I can on the topic (MSDN, other) but I can't make sense of this. Desired behavior; The user is to choose from the displayed list of the databound combobox...
0
by: rsimlote | last post by:
I have a datagridview with 5 comboboxes. After selecting choices in the first row, when the user move on to or enter into the combobox in the next row, the selection from the previous row displays...
2
by: niks4ward | last post by:
I want to display p_code in label when I select its respective name from a combobox. I m working on vb.net 2005. I ve also bounded the combo to table. Kindly suggest.
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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
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...

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.