As I said avoid adding duplicates initially. This code will attempt to add Point(1,1) ten times but the list will only contain the one entry.
List<Point> listPoint = new List<Point>();
pointToAdd = new Point(1, 1);
for (int i = 0; i <= 10; i++)
If you really need to remove, I think the way is to create a new 'clean list' by iterating through the current list, checking before adding to the new list and then assigning the clean list to the old one.
List<Point> CleanList(List<Point> listPoint)
List<Point> cleanList = new List<Point>();
foreach (Point currentPoint in listPoint)
Then you can simply call listPoint = CleanList(listPoint);
The free PowerCollections [^]
library has methods for this kind of thing. It's very easy to use if you're already comfortable with generic collections (which you should be if you're using .NET 2 or higher).
In a Forum we Help people Who got Stuck while Attempted to do something. You did not Attempt anything and you did not Attempt to make a reseasrch on Google on what is needed to build a POS System. please Next time Google before you ask Questions or else you will get negavite answers from other members
I didn't think of that type of concept for the Tag property.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
You are redirecting standard output.
As soon as make fills the output buffer, it will pause and wait until you read from the standard output.
So you have a deadlock there, make is waiting for your process to consume output, and your process is waiting for make to finish. You need to start reading output right away after starting the make process.
the data does get bound, but the weird part is when i select a value in any one of the combo boxes ALL the combo boxes selected items change to that...
any ideas as to why? i really dont feel like making separate data sources for each one, it'll be redundant cuz all the combos have the same data.... but them sharing the same data source is the only reason that i can see for this strange behavior.
Harvey Saayman - South Africa
.Net, C#, SQL
Well if you want your Combobox to Display data from one Data Source , it will be Simple, but the Behavior of Combox boxes in the Form will do , that am not sure why, but if you a for example searching based on what is selected , it will not give you a Problem, dont worry about it, i have never experienced a problem before and i understand what you mean. and if you want to bind your data fied to your Combobox, next time you can do it like this
private void dataBindTimeCatComboBoxes()
//create a new dataset
DataSet dataSet = new DataSet();
//create sql command
SqlCommand selectCommand = new SqlCommand("Proc_SelectTimeCategoryName", sqlConn);
selectCommand.CommandType = CommandType.StoredProcedure;
//create data adapter
SqlDataAdapter dataAdapter = new SqlDataAdapter();
dataAdapter.SelectCommand = selectCommand;
//Fill the dataset
//Data Bind the combo boxes //
//You Should Bind it like this
* comboBox6.DataSource = datasetname;
comboBox6.DisplayMember = "Tablename.Field";
comboBox2.DataSource = tCatTable;
comboBox2.DisplayMember = "tCat.TCat_Name_VC30";
comboBox3.DataSource = tCatTable;
comboBox3.DisplayMember = "tCat.TCat_Name_VC30";
comboBox4.DataSource = tCatTable;
comboBox4.DisplayMember = "tCat.TCat_Name_VC30";
comboBox5.DataSource = tCatTable;
comboBox5.DisplayMember = "tCat.TCat_Name_VC30";
comboBox6.DataSource = tCatTable;
comboBox6.DisplayMember = "tCat.TCat_Name_VC30";
Sometimes its not Necessaryto use datatable .remove that ValueMember property.
Hope it helps
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
Hi guys! one question if someone can help me. I have a listview and a checkbox. When the app is started the listview is populated from one folder. When the checkbox is checked the listview is automatically populating from different folder. Now, I want when the user will uncheck the checkbox, the listview to be populated again from the first folder. Any help? Thx
FileSystemWatcher fsw = new FileSystemWatcher("C:\\Photos\\Preview");
fsw.Changed += new FileSystemEventHandler(fsw_Changed);
fsw.Deleted += new FileSystemEventHandler(fsw_Changed);
fsw.Created += new FileSystemEventHandler(fsw_Changed);
fsw.EnableRaisingEvents = true;
the RefreshView method:
string files = Directory.GetFiles("C:\\Photos\\Preview");
foreach(string file in files)
so that is trigerred when the user is checking the checkBox. When the checkBox again is unchecked, then nothing is happening. There I want to retrieve again the previous folder, in this case("C:\\Photos")