rmtielman53 reputationPosted Mar 3, 2004, 7:39 AM EST
+1
hello x-box gamer.
I tried the following:
The part which has to make the stat column load in the datatable is not working. Actually Status is a subitem in my listview control(lv1).
for(int j=0; j
oblivion_lurksRank #9,026 · 212 reputationPosted Mar 6, 2004, 11:20 AM EST
+1
Sorry it took me soo long to respond Rt!! Ok well i looked over your above code a couple of times. I just tried a short practice program with my code implemented similiar to yours. You said that the SubItem isn't returning just the one subitem? Everything just worked fine for me. Heres my code:
this.listView.Items[0].SubItems.Add("strSubItem");
string str = this.listView.Items[0].SubItems[1].ToString();
MessageBox.Show(str);
Output: strSubItem
Is this similiar to what your wanting?
oblivion_lurksRank #9,026 · 212 reputationPosted Mar 10, 2004, 7:54 AM EST
+1
Oh ok i see what you mean. All you would need to to is implement the KeyPress event of the ComboBox!! With-in this method, provide a switch case for the letter pressed (make sure its a letter ex: char.IsLetter()) in order to jump to the first string starting with that letter. Hope this helps!!
rmtielman53 reputationPosted Mar 10, 2004, 10:06 AM EST
+1
Thks 4 the quick rep =)
I tried this, it compiles ok, but the combobox does not provide autocomplete when i start typing.(the combobox items get loaded from my db)
Pls help.
private void cboClient_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
{
int index;
string actual;
string found;
// Do nothing for certain keys, such as navigation keys.
if ((e.KeyCode == Keys.Back) ||
(e.KeyCode == Keys.Left) ||
(e.KeyCode == Keys.Right) ||
(e.KeyCode == Keys.Up) ||
(e.KeyCode == Keys.Down) ||
(e.KeyCode == Keys.Delete) ||
(e.KeyCode == Keys.PageUp) ||
(e.KeyCode == Keys.PageDown) ||
(e.KeyCode == Keys.Home) ||
(e.KeyCode == Keys.End))
{
return;
}
// Store the actual text that has been typed.
actual = this.cboClient.Text;
// Find the first match for the typed value.
index = this.cboClient.FindString(actual);
// Get the text of the first match.
if (index > -1)
{
found = this.cboClient.Items[index].ToString();
// Select this item from the list.
this.cboClient.SelectedIndex = index;
// Select the portion of the text that was automatically
// added so that additional typing replaces it.
this.cboClient.SelectionStart = actual.Length;
this.cboClient.SelectionLength = found.Length;
}
}
oblivion_lurksRank #9,026 · 212 reputationPosted Mar 10, 2004, 6:23 PM EST
+1
Oh ok, sorry i misunderstood you. Yeah i don't think the ComboBox class offers autocomplete. You might have to just implement the code yourself. Are you wanting to basically do the same thing that Intellisense does for you in visual studio?
oblivion_lurksRank #9,026 · 212 reputationPosted Mar 1, 2004, 10:26 AM EST
rmtielman53 reputationPosted Mar 3, 2004, 7:39 AM EST
oblivion_lurksRank #9,026 · 212 reputationPosted Mar 6, 2004, 11:20 AM EST
rmtielman53 reputationPosted Mar 7, 2004, 8:49 AM EST
rmtielman53 reputationPosted Mar 9, 2004, 8:53 AM EST
oblivion_lurksRank #9,026 · 212 reputationPosted Mar 9, 2004, 3:11 PM EST
rmtielman53 reputationPosted Mar 10, 2004, 5:52 AM EST
oblivion_lurksRank #9,026 · 212 reputationPosted Mar 10, 2004, 7:54 AM EST
rmtielman53 reputationPosted Mar 10, 2004, 10:06 AM EST
oblivion_lurksRank #9,026 · 212 reputationPosted Mar 10, 2004, 6:23 PM EST
rmtielman53 reputationPosted Mar 11, 2004, 4:12 AM EST
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts