Tag Archives: c++

Get week ID from DatePicker using C#

Questions: Following code for getting weekid CultureInfo ciCurr = CultureInfo.CurrentCulture; int Weekid = ciCurr.Calendar.GetWeekOfYear(dt, CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday); When I try for date 31/12/2018 it showed me week Id 53 but in my DatePicker it showed week Id 1 Refer image of DatePicker Question: which one is correct? how to make it same either change in C#… Read More »

How “pause” all children tasks of Parallel.ForEach in C#

Questions: I have seen several answers here on stack overflow dealing with the various times when one should use Thread.Sleep() or Task.Delay(), but I haven’t found an answer to my question. Here is the code: using Polly; //Nuget package named Polly public void Main() { var Index = new List<int>() {1,2,3,4,5,6,7,8,9,10}; Task loop = Task.Factory.StartNew(()… Read More »

C# Unable to copy file. Access to path is denied

Questions: When trying to build a winforms project, I am receiving the following error: Unable to copy file ProjectName\packages\MetroModernUI.\lib\net\Metroframework.dll to bin\Debug\MetroFramework.dll. Access to path ‘bin\Debug\MetroFramework.dll’ is denied. I used to be able to build just fine, I don’t know why this is happening. The only difference is that I am logging in off-site through my… Read More »

How can I handle MouseMove event on chart line in c#? [on hold]

Questions: I am new user in c# and I want to handle the MouseMove event on line to bold this //line and I want to know that, when mouse in on line show “Mouse_on_Line” be True? using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using… Read More »

C# .NET: Copy, Move and Delete File Progress

Questions: Problem I need to make a dialog, in wich there are two progress bars: One for total progress (if multiple files copied / moved / deleted) and one for the current file’s progress. I basically need to have some way of copying, moving and deleting files and know the progress of the corresponding process… Read More »

C# Put EventHandler in get statement

Questions: I am trying to put in an event handler in a user control, where an event handler of the controls in the control are linked to this event handler, as so: public EventHandler PicDoubleClick { get { return pictureBox1.DoubleClick; } set { pictureBox1.DoubleClick += value; label1.DoubleClick += value; label2.DoubleClick += value; } } But… Read More »