Click here to Skip to main content
15,887,436 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: Move Rectangle with TranslateTransform Pin
Kenneth Haugland4-Feb-15 2:59
mvaKenneth Haugland4-Feb-15 2:59 
QuestionA Calendar day to drag and drop Pin
Zorig. A.1-Feb-15 1:45
Zorig. A.1-Feb-15 1:45 
AnswerRe: A Calendar day to drag and drop Pin
Mycroft Holmes1-Feb-15 11:53
professionalMycroft Holmes1-Feb-15 11:53 
QuestionUpdate text of one textbox to multiple textbox using XAML Pin
Ashfaque Hussain26-Jan-15 23:17
Ashfaque Hussain26-Jan-15 23:17 
AnswerRe: Update text of one textbox to multiple textbox using XAML Pin
Richard Deeming27-Jan-15 1:40
mveRichard Deeming27-Jan-15 1:40 
GeneralRe: Update text of one textbox to multiple textbox using XAML Pin
Ashfaque Hussain27-Jan-15 8:13
Ashfaque Hussain27-Jan-15 8:13 
QuestionTrouble setting cooperative level [SharpDX] Pin
Jayme6523-Jan-15 6:00
Jayme6523-Jan-15 6:00 
QuestionCode only working with break points Pin
Dominick Marciano9-Jan-15 19:14
professionalDominick Marciano9-Jan-15 19:14 
I have a very strange issue that I have been unable to resolve. I have a window that is opened on a new thread that contains a custom control box with the min, max, and close buttons as ellipses, with handlers attached:
XML
<StackPanel DockPanel.Dock="Right" Name="ControlBox" Orientation="Horizontal" HorizontalAlignment="Right" Height="22" VerticalAlignment="Center" Margin="0,4,0,0" Background="LightGray"  >
            <Ellipse Margin="5,0,5,0"  VerticalAlignment="Top" HorizontalAlignment="Right" 
                 Width="14" Height="15" MouseLeftButtonUp="btnMinimize_MouseLeftButtonUp" 
                 MouseEnter="ActivateTitleIcons" MouseLeave="DeactivateTitleIcons"
                 MouseLeftButtonDown="btnMinimize_MouseLeftButtonDown" Name="btnMinimize" 
                 Fill="{StaticResource Min_inact}" Visibility="{Binding Path=MinimizeButtonVisible, Converter={StaticResource ResourceKey=BooleanVisibilityConverter}}"/>
            <Ellipse Margin="0,0,5,0" VerticalAlignment="Top" HorizontalAlignment="Right" 
                 Width="14" Height="15" MouseLeftButtonUp="btnMaximize_MouseLeftButtonUp" 
                 MouseEnter="ActivateTitleIcons" MouseLeave="DeActivateTitleIcons" 
                 MouseLeftButtonDown="btnMaximize_MouseLeftButtonDown" Name="btnMaximize" 
                 Fill="{DynamicResource Max_inact}" Visibility="{Binding Path=MaximizeButtonVisible, Converter={StaticResource ResourceKey=BooleanVisibilityConverter}}"/>
            <Ellipse Margin="0,0,5,5" VerticalAlignment="Top" HorizontalAlignment="Right" 
                 Width="14" Height="15" MouseLeftButtonUp="btnClose_MouseLeftButtonUp" 
                 MouseEnter="ActivateTitleIcons" MouseLeave="DeActivateTitleIcons" 
                 MouseLeftButtonDown="btnClose_MouseLeftButtonDown" Name="btnClose" 
                 Fill="{DynamicResource Close_inact}" Visibility="{Binding Path=CloseButtonVisible, Converter={StaticResource ResourceKey=BooleanVisibilityConverter}}"/>
        </StackPanel>


As an example of the problem, here is the code for the minimize button's MouseLeftButtonDown and MouseLeftButtonUp handlers:
VB
Private Sub btnMinimize_MouseLeftButtonDown(ByVal sender As Object, ByVal e As MouseButtonEventArgs)
        btnMinimize.Fill = CType(Me.Resources("Min_pr"), ImageBrush)
End Sub

Private Sub btnMinimize_MouseLeftButtonUp(ByVal sender As Object, ByVal e As MouseButtonEventArgs)
        btnMinimize.Fill = CType(Me.Resources("Min_inact"), ImageBrush)
        SystemCommands.MinimizeWindow(_parent)
End Sub


Now if I just run the application, when I click the minimize button it changes to the proper image but when I let go of the mouse button nothing happens; the window doesn't minimize. Same thing if I set break points anywhere in the btnMinimize_MouseLeftButtonUp method, however if I set a break point on the Private Sub btnMinimize_MouseLeftButtonDown... line, then the window minimize as it should.

I have never come across this. How does the btnMinimize_MouseLeftButtonUp method run only if I set a break point on the Private Sub btnMinimize_MouseLeftButtonDown... line? Any suggestions on how this can be resolves is greatly appreciated.

Thank You
A black hole is where God tried to divide by zero.

There are 10 kinds of people in the world; those who understand binary and those who don't.

AnswerRe: Code only working with break points Pin
SledgeHammer019-Jan-15 19:15
SledgeHammer019-Jan-15 19:15 
AnswerRe: Code only working with break points Pin
Afzaal Ahmad Zeeshan9-Jan-15 20:29
professionalAfzaal Ahmad Zeeshan9-Jan-15 20:29 
QuestionAnybody using DwmExtendFrameIntoClientArea? Pin
SledgeHammer019-Jan-15 11:59
SledgeHammer019-Jan-15 11:59 
AnswerRe: Anybody using DwmExtendFrameIntoClientArea? Pin
Richard Deeming12-Jan-15 2:31
mveRichard Deeming12-Jan-15 2:31 
GeneralRe: Anybody using DwmExtendFrameIntoClientArea? Pin
SledgeHammer0112-Jan-15 4:52
SledgeHammer0112-Jan-15 4:52 
QuestionWhere to go to learn wpf? Pin
MrGlass35-Jan-15 8:44
MrGlass35-Jan-15 8:44 
AnswerRe: Where to go to learn wpf? Pin
SledgeHammer015-Jan-15 9:59
SledgeHammer015-Jan-15 9:59 
AnswerRe: Where to go to learn wpf? Pin
Mycroft Holmes5-Jan-15 12:11
professionalMycroft Holmes5-Jan-15 12:11 
GeneralRe: Where to go to learn wpf? Pin
SledgeHammer015-Jan-15 12:58
SledgeHammer015-Jan-15 12:58 
GeneralRe: Where to go to learn wpf? Pin
Mycroft Holmes5-Jan-15 13:21
professionalMycroft Holmes5-Jan-15 13:21 
AnswerRe: Where to go to learn wpf? Pin
Richard MacCutchan5-Jan-15 22:43
mveRichard MacCutchan5-Jan-15 22:43 
AnswerRe: Where to go to learn wpf? Pin
Vimalsoft(Pty) Ltd12-Jan-15 20:56
professionalVimalsoft(Pty) Ltd12-Jan-15 20:56 
AnswerRe: Where to go to learn wpf? Pin
Subramanyam Shankar17-Mar-15 1:04
professionalSubramanyam Shankar17-Mar-15 1:04 
QuestionMultithreaded Windows with Data Binding Pin
Dominick Marciano5-Jan-15 8:30
professionalDominick Marciano5-Jan-15 8:30 
AnswerRe: Multithreaded Windows with Data Binding Pin
Afzaal Ahmad Zeeshan9-Jan-15 8:41
professionalAfzaal Ahmad Zeeshan9-Jan-15 8:41 
AnswerRe: Multithreaded Windows with Data Binding Pin
SledgeHammer0111-Jan-15 8:37
SledgeHammer0111-Jan-15 8:37 
QuestionWPF DataGrid with ComBox Bound To Enums - Show Descriptions Pin
Kevin Marois5-Jan-15 7:03
professionalKevin Marois5-Jan-15 7:03 

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.