Click here to Skip to main content
15,499,289 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: BackgroundWorker Pin
hshan_10-Apr-22 6:29
Memberhshan_10-Apr-22 6:29 
GeneralRe: BackgroundWorker Pin
Richard Deeming18-Apr-22 22:42
mveRichard Deeming18-Apr-22 22:42 
GeneralRe: BackgroundWorker Pin
hshan_19-Apr-22 3:38
Memberhshan_19-Apr-22 3:38 
GeneralRe: BackgroundWorker Pin
Richard Deeming19-Apr-22 4:01
mveRichard Deeming19-Apr-22 4:01 
GeneralRe: BackgroundWorker Pin
hshan_19-Apr-22 4:22
Memberhshan_19-Apr-22 4:22 
GeneralRe: BackgroundWorker Pin
Richard Deeming19-Apr-22 4:50
mveRichard Deeming19-Apr-22 4:50 
GeneralRe: BackgroundWorker Pin
hshan_19-Apr-22 7:39
Memberhshan_19-Apr-22 7:39 
GeneralRe: BackgroundWorker Pin
hshan_19-Apr-22 3:55
Memberhshan_19-Apr-22 3:55 
private: System::Void start_Click(System::Object^ sender, System::EventArgs^ e) {
	backgroundWorker1->RunWorkerAsync(1);
	this->start->Visible = false;
}
private: System::Void backgroundWorker1_DoWork(System::Object^ sender, System::ComponentModel::DoWorkEventArgs^ e) {
	
	while (true)
	{
		if (backgroundWorker1->CancellationPending) //if it was cancelled
		{
			e->Cancel = true;
			
		}
		if (progressBar1->Value == progressBar1->Maximum)  //if the progress bar value reached maximum
		{
			
		}
		Beep(1500, 100);
		backgroundWorker1->ReportProgress(50);  //reporting progress
		Sleep(500);   //wait for 1 second
	}
}
	
private: System::Void cancel_Click(System::Object^ sender, System::EventArgs^ e) {
	backgroundWorker1->CancelAsync();
	this->start->Visible = true;
}
	   private: System::Void backgroundWorker1_ProgressChanged(System::Object^ sender, System::ComponentModel::ProgressChangedEventArgs^ e) {

		   progressBar1->Value += e->ProgressPercentage;  //rising the progressbar's value

	   }
private: System::Void backgroundWorker1_RunWorkerCompleted(System::Object^ sender, System::ComponentModel::RunWorkerCompletedEventArgs^ e) {
	this->start->Visible = true;
	progressBar1->Value = 0;   //reseting value

	if (e->Cancelled)    //Messages for the events
	{
		MessageBox::Show("kiss my ass ");
	}
	else
	{
		MessageBox::Show("eat my sh*t ");
	}
}
};
}

^
|
|
this sh*t above is from Add new comment | Free Source Code[^]
where i found one and only tutorial how to use background worker in c++ an not in c#
to this moment i was only using some formulas from it but now i coppied everything AND.....
it's not working
progress bar is not updating
i wasn't even sure if it works untill i added beep
and it works but not quite
not updating this f***ing progress bar
cancel button doesn't work (but it kinda does)
i'm really on the edge right now im this >< close to lose my sh*t
QuestionCan not create object of DirectorySearcher class with Visual C++ with project reference of System.DirectoryServices.dll Pin
Alex Banar1-Apr-22 5:23
MemberAlex Banar1-Apr-22 5:23 
AnswerRe: Can not create object of DirectorySearcher class with Visual C++ with project reference of System.DirectoryServices.dll Pin
Richard MacCutchan1-Apr-22 5:38
mveRichard MacCutchan1-Apr-22 5:38 
GeneralRe: Can not create object of DirectorySearcher class with Visual C++ with project reference of System.DirectoryServices.dll Pin
Alex Banar1-Apr-22 5:42
MemberAlex Banar1-Apr-22 5:42 
GeneralRe: Can not create object of DirectorySearcher class with Visual C++ with project reference of System.DirectoryServices.dll Pin
Richard MacCutchan1-Apr-22 6:44
mveRichard MacCutchan1-Apr-22 6:44 
GeneralRe: Can not create object of DirectorySearcher class with Visual C++ with project reference of System.DirectoryServices.dll Pin
Alex Banar1-Apr-22 7:22
MemberAlex Banar1-Apr-22 7:22 
GeneralRe: Can not create object of DirectorySearcher class with Visual C++ with project reference of System.DirectoryServices.dll Pin
Richard MacCutchan1-Apr-22 7:28
mveRichard MacCutchan1-Apr-22 7:28 
GeneralRe: Can not create object of DirectorySearcher class with Visual C++ with project reference of System.DirectoryServices.dll Pin
Alex Banar1-Apr-22 7:49
MemberAlex Banar1-Apr-22 7:49 
Questionrunning Powershell from ASP.NET Core 6 Pin
Johannes B. Latzel18-Mar-22 3:20
MemberJohannes B. Latzel18-Mar-22 3:20 
AnswerRe: running Powershell from ASP.NET Core 6 Pin
Dave Kreskowiak27-Mar-22 19:17
mveDave Kreskowiak27-Mar-22 19:17 
QuestionC# TcpListener listen forever Pin
Goga Work11-Mar-22 19:42
MemberGoga Work11-Mar-22 19:42 
AnswerRe: C# TcpListener listen forever Pin
Pete O'Hanlon11-Mar-22 21:57
mvaPete O'Hanlon11-Mar-22 21:57 
QuestionPower BI Embedded : Cant doCross Filtering selecting multiple rows on a table visual pressing CTRL Pin
Member 155547063-Mar-22 18:19
MemberMember 155547063-Mar-22 18:19 
Questionhow it works Pin
Calin Negru17-Feb-22 9:48
MemberCalin Negru17-Feb-22 9:48 
QuestionRe: how it works Pin
Calin Negru17-Feb-22 11:41
MemberCalin Negru17-Feb-22 11:41 
AnswerRe: how it works Pin
jschell17-Feb-22 11:44
Memberjschell17-Feb-22 11:44 
AnswerRe: how it works Pin
Richard MacCutchan17-Feb-22 22:35
mveRichard MacCutchan17-Feb-22 22:35 
GeneralRe: how it works Pin
Calin Negru18-Feb-22 3:17
MemberCalin Negru18-Feb-22 3:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.