|
Hi,
OldSchoolToC# wrote: I'm not sure how combobox_TextUpdate is different from combobox_TextChanged.
that detail is hidden in the documentation.
OldSchoolToC# wrote: someone has finished entering text
how could anyone tell? do you do something special when entering the last character? Your app won't read your mind, so either you implement a time-out mechanism (bad idea), or you make the user do something special, like clicking a button to start acting on the new information. How does the find dialog work in MS Word or Windows Explorer? it has a TextBox and a "Find" button.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
What about using the LostFocus and TextChanged event (I think that's it)? You could set a flag in the TextChanged event, and if that flag is true on LostFocus, then your change is committed.
Or, use OnKeyPress and check that the Enter key was pressed.
Dybs
|
|
|
|
|
Thanks! Your suggestion is very helpful. I think I have a good idea now of what I need to do.
|
|
|
|
|
And what if the use want's to cancel and not use the data typed into the Combo?? His idea is not a good one... Clicking on a Cancel button will cause the LostFocus event to fire on the Combo first.
|
|
|
|
|
Good point, I didn't think about cancelling the change. In that case, forget about LostFocus and just use OnKeyPress and require the user to press Enter or Tab to commit the text. I think for a lot of people it's just habit anyway to press Enter or Tab when you're done entering text for a field.
Dybs
|
|
|
|
|
Can you find something like Validating or Validated event in combo box..
|
|
|
|
|
I have a situation where I need to do a lookup on a table with 3 million records against a table with 150 million records.
I can't think of any fast way to do this in normal c# code, so I think a join on the table would be the most appropriate. Only problem is that the resultset at the end could potentially be 3 million records.
How would I go about going through all these records without attempting to load them all into memory at once with a DataSet. Any ideas would be great.
Thanks in advance
|
|
|
|
|
Pick 'em off one at a time with a DataReader[^]? Might take a while to process though
I are troll
|
|
|
|
|
That depends on what you want to go through them for. If it's some conditional value, then create the recordset from an sql statement and use sql to parse down the data to just what you need returned to the client.
Also if there is any user interaction between using these records, you're better off returning just the row or a page of rows at a time.
EDIT: Also to save you're sanity, make sure the joins and and parameters are using indexes. Otherwise you could age before you get your data.
The true man wants two things: danger and play. For that reason he wants woman, as the most dangerous plaything.
|
|
|
|
|
I am working in a Windows application using C#. I have a text box and a button. After entering something in the text box and pressing the button it should output the number of letters of the word.
For example if I type "Good"
it should display
There are 1Gs
There are 2Os
There are 1Ds
case sensitivity is not an issue here.
Should I use Linq for it or use something else
|
|
|
|
|
Hi,
You could do that with the oldest .NET version, you don't need all the fancy stuff, it just complicates simple tasks like this one. Besides, you asking this tells me you are not ready for the fancy stuff anyhow. How about buying a tutorial book on C# and working your way through it?
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
First off, I have read this article:
http://msdn.microsoft.com/en-us/library/bb264562.aspx#[^]
And I have created the classes it mentions and I understand how to change the properties and all that. That is the easy part.
My problem is how do I get the installer to trigger this wrapper during the application install process to get SQL Server installed?
I have made many setup packages, but I've never tried to roll the installation of SQL Server itself into the setup package and I'm hitting a major brick wall and just can't get it figured out.
I have my application, let's call it "MainProgram". I then created a secondary application called "SQLInstaller" that consists of the classes outlined in the article, and have built that exe. What I can't figure out is how to make the installer run my "SQLInstaller" during the installation of "MainProgram". I'm sure I'm making this more difficult than it needs to be, but I've just not been able get it, and all google articles seem to merely point back to the original article I've already read.
Any assistance that would clarify the missing pieces would be greatly appreciated.
|
|
|
|
|
I hate to be that guy that bumps his topics, but I'm really hoping someone out there has a sample project or something I can look at to help me figure out where I'm going wrong
|
|
|
|
|
Hi
VS2005 winforms
Is it possible to programatically open a dropdown list?
- similar to a user clicking on the button on the right hand side?
Thanks,
Chas
|
|
|
|
|
if you're talking about the drop down list in a combo box then it's: comboBox1.DroppedDown = true;
|
|
|
|
|
Thats what I was after
Thanks
Chas
|
|
|
|
|
Have a c++ app that may be converted to c#, but I am having a problem with this:
c++ A buffer is read off a socket, and the first byte represents a message id, which cooresponds to a particular typedef:
typedef SAMPLE {
uint16 msg_id;
char status[10];
uint16 value};
and I can simple do this: sample = (SAMPLE)data_buffer_read_of_the_socket
and sample.msg_id, sample.status, and sample.value are filled in nicely.
I cannot seem to find any equivalent way of doing this in C#. Can anyone help?
|
|
|
|
|
You're looking for serialization[^], of the binary kind
--edit--
I know that's it's not the same as casting, but it's easy to do and won't cost that much extra time.
I are troll
|
|
|
|
|
I am having a problem with sorting a multi-column ListBox. For simplicity, let's say I only have 3 columns: Id, Score, and TotalPoints. I have implemented a Compare method from the IComparer interface that looks like this:
public int Compare(object x, object y)
{
int compareResult;
ListViewItem listviewX, listviewY;
listviewX = (ListViewItem)x;
listviewY = (ListViewItem)y;
compareResult = ObjectCompare.Compare(listviewX.SubItems[ColumnToSort].Text, listviewY.SubItems[ColumnToSort].Text);
if (OrderOfSort == SortOrder.Ascending)
{
return compareResult;
}
else if (OrderOfSort == SortOrder.Descending)
{
return (-compareResult);
}
else
{
return 0;
}
}
The sorting is inaccurate though. For example, let's say I have 3 rows, and the Scores are 10, 11, and 2. When I sort the column, it displays 10, 11, then 2...not 11, 10, 2. I am pretty sure it has something to do with the number of digits in the string, but I have no idea how to resolve it. For the most part the sorting works, just this little kink. Any help would be greatly appreciated.
Thanks
|
|
|
|
|
dfb78 wrote: compareResult = ObjectCompare.Compare(listviewX.SubItems[ColumnToSort].Text, listviewY.SubItems[ColumnToSort].Text);
dfb78 wrote: and the Scores are 10, 11, and 2. When I sort the column, it displays 10, 11, then 2...not 11, 10, 2.
You are doing text (ASCII) comparison. You need to change your text to int/long then compare.
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
Duh! That was it, thank you!
|
|
|
|
|
Hi,
I have several remarks:
1.
if it contains ListViewItems, I guess your Control is a ListView, not a ListBox.
2.
you did not show code for ObjectCompare, which does the actual compare.
3.
all we can see is ObjectCompare takes two strings; if all it does is compare the strings, then the right order is 10, 11, 2 since strings by default get sorted alphabetically based on their individual characters, taken from left to right, hence 11 comes before 2 since '1'<'2'
4.
if OrderOfSort happens to be SortOrder.Unspecified then any result would be correct.
5.
I don't know how you populate your ListView; if you have objects that hold numeric values (such as Id, Score and TotalValue) then it does not make much sense to convert them to string (so you can show them in the ListView) and then try and convert that string back to integers so you can perform a correct compare. You could use the ListViewItem.Tag to hold a reference to your object, and then perform the necessary comparison directly using the integer values.
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
|
|
|
|
|
hi every body
I want to make profetional calculator for complex operation
such as to calculate this statement A+B(f*g-r)/A+B .. and somthing like that
how can i do that??
|
|
|
|
|
By learning how statements and equations (and something like that) work
Where do you want to start?
I are troll
|
|
|
|
|
thanks
I know many thing about statement and stack and some thing about priorities
and about prefix and postfix ..etc
just I need some helps like idea and some codes
|
|
|
|