Click here to Skip to main content
15,889,776 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Problems Merging a MediaPlayer SL2Gallery Template into an Existing SL 2 App Pin
Michael Sync28-Jul-09 6:04
Michael Sync28-Jul-09 6:04 
GeneralRe: Problems Merging a MediaPlayer SL2Gallery Template into an Existing SL 2 App Pin
SBJ28-Jul-09 12:32
SBJ28-Jul-09 12:32 
GeneralRe: Problems Merging a MediaPlayer SL2Gallery Template into an Existing SL 2 App Pin
Michael Sync29-Jul-09 5:12
Michael Sync29-Jul-09 5:12 
GeneralRe: Problems Merging a MediaPlayer SL2Gallery Template into an Existing SL 2 App Pin
SBJ11-Aug-09 15:31
SBJ11-Aug-09 15:31 
QuestionHow to build a WPF report for WPF application ? Pin
error197926-Jul-09 6:19
error197926-Jul-09 6:19 
AnswerRe: How to build a WPF report for WPF application ? Pin
Sperneder Patrick26-Jul-09 7:46
professionalSperneder Patrick26-Jul-09 7:46 
AnswerRe: How to build a WPF report for WPF application ? Pin
Pete O'Hanlon26-Jul-09 10:25
mvePete O'Hanlon26-Jul-09 10:25 
QuestionBackGroundWorker In WPF Problem Pin
Member 306874125-Jul-09 14:56
Member 306874125-Jul-09 14:56 
This is very basic BackgroundWorker Example but I dont know why the progress bar run 2 times. It should run only 1 time. anyone can help me.

Imports Microsoft.VisualBasic
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Text
Imports System.Threading
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Data
Imports System.Windows.Documents
Imports System.Windows.Input
Imports System.Windows.Media
Imports System.Windows.Media.Imaging
Imports System.Windows.Shapes


Namespace WindowsApplication1
	

	Partial Public Class Window1
		Inherits System.Windows.Window
        Private WithEvents _worker As BackgroundWorker
		Public Sub New()
			InitializeComponent()
		End Sub

		Private Sub StartWorker(ByVal sender As Object, ByVal e As RoutedEventArgs)

		End Sub

        

		Private Sub button1_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
            _worker = New BackgroundWorker()
			_worker.WorkerReportsProgress = True
			_worker.WorkerSupportsCancellation = True

            AddHandler _worker.DoWork, AddressOf DoWorkEventHandler


            AddHandler _worker.ProgressChanged, AddressOf ProgressChangedEventHandler
            AddHandler _worker.RunWorkerCompleted, AddressOf RunWorkerCompletedEventHandler
			_worker.RunWorkerAsync()
			_btnStart.IsEnabled = False
			_btnCancel.IsEnabled = True
		End Sub
		
		
        Private Sub DoWorkEventHandler(ByVal s As Object, ByVal args As DoWorkEventArgs) Handles _worker.DoWork
            Dim worker As BackgroundWorker = TryCast(s, BackgroundWorker)
            For i As Integer = 0 To 4
                If worker.CancellationPending Then
                    args.Cancel = True
                    Return
                End If
                Thread.Sleep(100)
                worker.ReportProgress(i + 1)
            Next i
        End Sub
		
        Private Sub ProgressChangedEventHandler(ByVal s As Object, ByVal args As ProgressChangedEventArgs) Handles _worker.ProgressChanged
            _progressBar.Value = args.ProgressPercentage

        End Sub
		
        Private Sub RunWorkerCompletedEventHandler(ByVal s As Object, ByVal args As RunWorkerCompletedEventArgs) Handles _worker.RunWorkerCompleted
            _btnStart.IsEnabled = True
            _btnCancel.IsEnabled = False
            _progressBar.Value = 0

        End Sub
        Private Sub CancelWorker(ByVal sender As Object, ByVal e As RoutedEventArgs)
            _worker.CancelAsync()
        End Sub
	End Class
End Namespace

AnswerRe: BackGroundWorker In WPF Problem Pin
Mark Salsbery27-Jul-09 5:21
Mark Salsbery27-Jul-09 5:21 
Questionhi,how should i use wpf draw staff gauge ? Pin
KornZhang25-Jul-09 5:23
KornZhang25-Jul-09 5:23 
AnswerRe: hi,how should i use wpf draw staff gauge ? Pin
KornZhang25-Jul-09 5:24
KornZhang25-Jul-09 5:24 
QuestionWPF browser application on MAC browsers Pin
VijayVishwakarma25-Jul-09 2:21
VijayVishwakarma25-Jul-09 2:21 
AnswerRe: WPF browser application on MAC browsers Pin
teejayem25-Jul-09 11:35
teejayem25-Jul-09 11:35 
QuestionWebsite + wpf application Pin
bhavna432124-Jul-09 20:57
bhavna432124-Jul-09 20:57 
QuestionRe: Website + wpf application Pin
Mark Salsbery27-Jul-09 5:23
Mark Salsbery27-Jul-09 5:23 
QuestionCustom property for user control Pin
krishnan.s24-Jul-09 20:32
krishnan.s24-Jul-09 20:32 
AnswerRe: Custom property for user control Pin
BillWoodruff24-Jul-09 22:54
professionalBillWoodruff24-Jul-09 22:54 
Questionequivalent method Dispose() in WPF? Pin
mehdibahadori24-Jul-09 19:25
mehdibahadori24-Jul-09 19:25 
AnswerRe: equivalent method Dispose() in WPF? [modified] PinPopular
#realJSOP24-Jul-09 23:02
mve#realJSOP24-Jul-09 23:02 
GeneralRe: equivalent method Dispose() in WPF? Pin
Pete O'Hanlon27-Jul-09 1:59
mvePete O'Hanlon27-Jul-09 1:59 
AnswerRe: equivalent method Dispose() in WPF? Pin
Kunal Chowdhury «IN»26-Jul-09 20:21
professionalKunal Chowdhury «IN»26-Jul-09 20:21 
QuestionMessage Removed Pin
24-Jul-09 9:48
professionalN_tro_P24-Jul-09 9:48 
AnswerMessage Removed Pin
24-Jul-09 9:49
professionalN_tro_P24-Jul-09 9:49 
GeneralRe: Binding IsEnabled of a button Pin
Ian Shlasko24-Jul-09 9:57
Ian Shlasko24-Jul-09 9:57 
GeneralMessage Removed Pin
24-Jul-09 10:06
professionalN_tro_P24-Jul-09 10:06 

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.