[Solved] Automatic start/refresh of ListBox

[ad_1] You need a timer that each time it runs, either update the list view’s current items or just clear and re-add new items: Timer timer = new Timer{ Interval = 60000, Enabled = true }; //every minute timer.Tick += (s, e) => { chatverlauf.Items.Clear(); var StatusList = … // get the list of servers … Read more

[Solved] How do I import data from a class C#

[ad_1] This code returns ordered names of all men in collection: public static IEnumerable<string> OrderedMales(IEnumerable<Person> persons) { return persons.Where(p => p.Sex == Gender.Male).OrderBy(p => p.Name).Select(p => p.Name); } 0 [ad_2] solved How do I import data from a class C#

[Solved] Issue with drag and drop

[ad_1] You may use a BackgroundWorker to do the operation that you need in different thread like the following : BackgroundWorker bgw; public Form1() { InitializeComponent(); bgw = new BackgroundWorker(); bgw.DoWork += bgw_DoWork; } private void Form1_DragDrop(object sender, DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.FileDrop)) { string[] s = (string[])e.Data.GetData(DataFormats.FileDrop, false); bgw.RunWorkerAsync(s); } } Also for your … Read more

[Solved] why “where” changing the original data type

[ad_1] LINQ methods work on enumerations, and always yield an IEnumerable<T> of some kind. If you want to convert back to the original collection type, you’d have to do that yourself in code. If CogoPointCollection has an appropriate constructor, for example, you could do this: CogoPointCollection COGOPointsCollection = civilAcitveDoc.CogoPoints; var cogoCollection2 = new CogoPointCollection ( … Read more

[Solved] Is this a effective way to delete entire linked list?

[ad_1] I like to handle this problem recursively: void deleteNode(Node * head) { if(head->pNext != NULL) { deleteNode(head->pNext) } delete head; } If we have a list of 5 items: head->pNext->pNext->pNext->pNext->NULL; Then, the function will first get called for head, then for each pNext until the last one. When we reach the last one, it … Read more

[Solved] c++ is there a flag for c++17 osx 10.13.6

[ad_1] Google is your friend, so is Wikipedia. From the GCC website, we can see that there is experimental/support for C++17 standard, through the -std=c++17 flag. From this awesome wiki article, there is a cross reference list for functionality and features. It indicates that std::any is supported in version GCC >= 7, but only on … Read more

[Solved] How do I get equal and not equal value between two list using Linq lambda expression

[ad_1] Enumerable.Intersect can give you the IDs that occur in both lists. e.g. id_list.Select(x => x.ID.ToString()).Intersect(ListID) Enumerable.Except can give you the IDs in the first list that do not occur in the second. e.g. ListID.Except(id_listSelect(x => x.ID.ToString()) 1 [ad_2] solved How do I get equal and not equal value between two list using Linq lambda … Read more

[Solved] Shows red mark on MessageBox.Show [closed]

[ad_1] As you’ve deduced, MessageBox does indeed belong to System.Windows.Forms. Unless you have created a Windows Forms project, the reference to this library will not automatically be added to your project. You can add it to other project types by doing this: Right-click “References” under your project in the Solution Explorer Click “Add reference” Select … Read more

[Solved] Unable to convert this Pascal code to C# [closed]

[ad_1] I think it will be something like that: static void Main(string[] args) { Console.Clear(); //unnecessary Console.Write(“Variant=”); int vers = Int32.Parse(Console.ReadLine()); Console.Write(“Number of works=”); int n = Int32.Parse(Console.ReadLine()); string X = vers.ToString(); string FileName = “Shed” + X + “.tab”; //or string FileName = “Shed” + vers.ToString() + “.tab”; //without unnecessary X variable System.IO.File.WriteAllText(FileName, string.Empty); … Read more

[Solved] C/SDL – Segmentation fault when program run multiple times in succession [closed]

[ad_1] Let me break down a debugging session for you, but in future you better do that yourself. If the problem can be easily reproduced, it is quite trivial to fix it: gdb ./GAME (gdb) r Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7b2d10c in ?? () from /usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0 (gdb) bt #0 0x00007ffff7b2d10c in ?? () … Read more

[Solved] If we use an array of linked list to implement hash table, “add” could be implemented in a way that no traversing is needed. Is this true or false?

[ad_1] If we use an array of linked list to implement hash table, “add” could be implemented in a way that no traversing is needed. Is this true or false? [ad_2] solved If we use an array of linked list to implement hash table, “add” could be implemented in a way that no traversing is … Read more