2014-09-22 10 views
0

오케이 여러분, C#에 익숙하지는 않지만 잘 지내고 있습니다.WPF NotifyIcon 풍선이 나타나지 않습니다.

시스템 트레이에 최소화 된 응용 프로그램이 있는데이 작업을 수행하려면 WPF NotifyIcon을 사용하고 있습니다. 내장 된 거품 팁 기능을 사용하려고합니다.

오류가 발생하지 않았지만 작동하지 않는 것 같습니다. 다음과 같이

내 코드는 다음과 같습니다

private void OnTaskBarMenuItemExitClick(object sender, RoutedEventArgs e) 
    { 
     m_isExplicitClose = true;//Set this to unclock the Minimize on close 

     this.Close(); 

     string title = "WPF NotifyIcon"; 
     string text = "This is a standard balloon"; 

     TaskBar.ShowBalloonTip(title, text, Properties.Resources.Server); 
    } 

어떤 일이해야 할 것은 내가 응용 프로그램을 닫을 때,이 시스템 트레이에 숨 깁니다 (및 않습니다)뿐만 아니라 BalloonTip 팝업한다 (그리고하지 않습니다)이다 .

아이디어가 없습니다. 나는 곤두박질 친다. :(

+0

는'()'대신'닫기()' –

+0

이의 숨기기를 사용해보십시오. Close()는 양식이 번지는 것을 방지합니다 – Pavenhimself

+0

숨기기/닫기 기능과 관련이 없습니다. 풍선은 다른 기능에서도 작동하지 않습니다. –

답변

2

을, 우리는이 문제를 일으키는 아이콘이었다 결론에 도달했습니다 .

private void OnTaskBarMenuItemExitClick(object sender, RoutedEventArgs e) 
{ 
    m_isExplicitClose = true;//Set this to unclock the Minimize on close 

    this.Close(); 

    string title = "WPF NotifyIcon"; 
    string text = "This is a standard balloon"; 

    TaskBar.ShowBalloonTip(title, text, BalloonIcon.Error); 
} 

제대로 근무하고 나타나지 않는 풍선의 문제를 해결.

+0

너무 많은 예 오 마이 갓. –

0
private void OnTaskBarMenuItemExitClick(object sender, RoutedEventArgs e) 
{ 
    m_isExplicitClose = true;//Set this to unclock the Minimize on close 

    this.Hide(); 

    string title = "WPF NotifyIcon"; 
    string text = "This is a standard balloon"; 

    TaskBar.ShowBalloonTip(title, text, Properties.Resources.Server); 
} 

체크 아웃 링크 :이 아이콘 형식에 대한 몇 가지 제약 조건 그리고 포스터와 TeamViewer를 세션을 수행 한 http://www.techotopia.com/index.php/Hiding_and_Showing_Forms_in_C_Sharp

+0

숨기기/닫기 기능과 관련이 없습니다. 풍선이 다른 기능에서도 작동하지 않습니다. –

+0

BeginInvoke()를 더 잘 사용하는 것처럼 들리므로이 특별한 경우를 위해 다른 스레드를 시작하십시오. – deafjeff

+0

@deafjeff 댓글이 분명하지 않습니다. 무엇에'BeginInvoke'를 부르시겠습니까? UI 요소라면 새로운 스레드가 분명히 사용되지 않을 것입니다. –