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

.NET (Core and Framework)

 
GeneralRe: BackgroundWorker Pin
hshan_10-Apr-22 5:29
hshan_10-Apr-22 5:29 
GeneralRe: BackgroundWorker Pin
Richard Deeming18-Apr-22 21:42
mveRichard Deeming18-Apr-22 21:42 
GeneralRe: BackgroundWorker Pin
hshan_19-Apr-22 2:38
hshan_19-Apr-22 2:38 
GeneralRe: BackgroundWorker Pin
Richard Deeming19-Apr-22 3:01
mveRichard Deeming19-Apr-22 3:01 
GeneralRe: BackgroundWorker Pin
hshan_19-Apr-22 3:22
hshan_19-Apr-22 3:22 
GeneralRe: BackgroundWorker Pin
Richard Deeming19-Apr-22 3:50
mveRichard Deeming19-Apr-22 3:50 
GeneralRe: BackgroundWorker Pin
hshan_19-Apr-22 6:39
hshan_19-Apr-22 6:39 
GeneralRe: BackgroundWorker Pin
hshan_19-Apr-22 2:55
hshan_19-Apr-22 2: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 4:23
Alex Banar1-Apr-22 4:23 
AnswerRe: Can not create object of DirectorySearcher class with Visual C++ with project reference of System.DirectoryServices.dll Pin
Richard MacCutchan1-Apr-22 4:38
mveRichard MacCutchan1-Apr-22 4:38 
GeneralRe: Can not create object of DirectorySearcher class with Visual C++ with project reference of System.DirectoryServices.dll Pin
Alex Banar1-Apr-22 4:42
Alex Banar1-Apr-22 4:42 
GeneralRe: Can not create object of DirectorySearcher class with Visual C++ with project reference of System.DirectoryServices.dll Pin
Richard MacCutchan1-Apr-22 5:44
mveRichard MacCutchan1-Apr-22 5:44 
GeneralRe: Can not create object of DirectorySearcher class with Visual C++ with project reference of System.DirectoryServices.dll Pin
Alex Banar1-Apr-22 6:22
Alex Banar1-Apr-22 6:22 
GeneralRe: Can not create object of DirectorySearcher class with Visual C++ with project reference of System.DirectoryServices.dll Pin
Richard MacCutchan1-Apr-22 6:28
mveRichard MacCutchan1-Apr-22 6:28 
GeneralRe: Can not create object of DirectorySearcher class with Visual C++ with project reference of System.DirectoryServices.dll Pin
Alex Banar1-Apr-22 6:49
Alex Banar1-Apr-22 6:49 
Questionrunning Powershell from ASP.NET Core 6 Pin
Johannes B. Latzel18-Mar-22 2:20
Johannes B. Latzel18-Mar-22 2:20 
AnswerRe: running Powershell from ASP.NET Core 6 Pin
Dave Kreskowiak27-Mar-22 18:17
mveDave Kreskowiak27-Mar-22 18:17 
QuestionC# TcpListener listen forever Pin
Goga Work11-Mar-22 18:42
Goga Work11-Mar-22 18:42 
AnswerRe: C# TcpListener listen forever Pin
Pete O'Hanlon11-Mar-22 20:57
subeditorPete O'Hanlon11-Mar-22 20:57 
QuestionPower BI Embedded : Cant doCross Filtering selecting multiple rows on a table visual pressing CTRL Pin
Member 155547063-Mar-22 17:19
Member 155547063-Mar-22 17:19 
Questionhow it works Pin
Calin Negru17-Feb-22 8:48
Calin Negru17-Feb-22 8:48 
QuestionRe: how it works Pin
Calin Negru17-Feb-22 10:41
Calin Negru17-Feb-22 10:41 
AnswerRe: how it works Pin
jschell17-Feb-22 10:44
jschell17-Feb-22 10:44 
AnswerRe: how it works Pin
Richard MacCutchan17-Feb-22 21:35
mveRichard MacCutchan17-Feb-22 21:35 
GeneralRe: how it works Pin
Calin Negru18-Feb-22 2:17
Calin Negru18-Feb-22 2: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.