2012-11-26 2 views
0

실행중인 프레임 워크 4.0 (VB.net)응용 프로그램이 application.run (FRM)과 함께 작업 표시 줄에 표시되지 않습니다. 시도한 여러 항목

ShowInTaskbar 속성은 True로 설정됩니다.

여기에서 주 창을 실행할 코드입니다. 내가 양식을 클릭하는 경우에도 모든 코드

Public Overridable Sub FormBase_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 
    Try 


     If Not designmode AndAlso Not Application.ExecutablePath.ToLower().IndexOf("devenv.exe") > -1 Then 
      If EasyDealINI.FichierINIEasyDealTailleDefaut = False Then 

       Me.Height = CInt(Me.Height * Ratio) 
       Me.Width = CInt(Me.Width * Ratio) 
       Me.Font = New Font(Me.Font.FontFamily, (Me.Font.Size * Ratio) - (DIMINUEUR_RATIO_POLICE * Ratio), Me.Font.Style) 


       Me.CenterToScreen() 

       UC_MenuBottom.AjusterControles() 
       UC_MenuBottom.AppliquerTypeBouton() 
      End If 
     End If 


     If Not DesignMode Then 
      'Sert à ce qu'EasyDeal en plein écran n'ait pas l'air d'un Transformer qui se déplie. 
      'Me.Visible = False --> Suspend le layout dans FormBaseDetailCalcul (voir AjusterControls) - Philippe 2008/06/04 

      If Not FormBase.DossierImagesPath Is Nothing Then 
       Dim strNomFichier As String = FormBase.DossierImagesPath & "Icone.ico" 'Le signe chinois 
       'Dim strNomFichier As String = FormBase.DossierImagesPath & "Logo.ico" 'La terre 
       Dim Fichier As New FileInfo(strNomFichier) 
       If Fichier.Exists Then 
        Me.Icon = New Icon(strNomFichier) 
       End If 
      End If 
     End If 

     Me.MaximizeBox = False 
     Me.MinimizeBox = True 
     DesactiverCloseBouton() 

     'Pour permettre que sur le ENTER la navigation se fasse comme en Access 
     '(Agir comme un (TAB)... Voir évenement FormBase_KeyUp 
     Me.KeyPreview = True 
     Me.ShowInTaskbar = True 
     Me.StartPosition = FormStartPosition.CenterScreen 

     Me.AppliquerCouleurs(Me) 

     'on met Easydeal comme texte de fenêtre 
     Me.Text = DEFAULT_WINDOW_TEXT 
     Me.Focus() 
     Me.Activate() 

    Catch ex As Exception 
     HandleException(ex) 
    End Try 
End Sub 

는하지만이 도움이되지 않는 상속 양식에서 frmMain 수 여기

Private Sub frmMain_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 
    Try 
     Application.DoEvents() 
     Me.Focus() 
     Me.Activate() 

     PeutExecuterSynchronisationAutomatique = True 
     'placer le bouton d'aide en ligne 
     btnAideToolTip.Location = New Point((btnPreference.Location.X - btnAideToolTip.Width) - 5, btnAideToolTip.Location.Y) 
     btnAideToolTip.Visible = True 



     Label5.Text = "version(x)" 

    Catch ex As Exception 
     HandleException(ex) 
    End Try 
End Sub 

모든 코드에서 다음

Dim frm As New frmMain 
frm.ShowInTaskbar = True 
Application.Run(frm) 

, 앱이 작업 표시 줄에 나타나지 않습니다.

그러나 정말 이상한 점은 중단 점을 넣거나 처음 작업 표시 줄을 클릭 한 다음 프로그램이 작업 표시 줄에 나타나는 양식을 다시 클릭하면됩니다.

alt-tab을 사용하면 작업 표시 줄에도 프로그램을 표시 할 수 있습니다.

감사합니다.

+0

더 많은 코드를 붙여주세요. 양식로드 이벤트는 최소한 –

+0

입니다. 여기에 많이 없습니다. – Pilouk

+0

응용 프로그램에 제목이 있습니까? –

답변

0

이 같은 논리가 미안 적용 난 단지 C#을 예를 가지고 있지만 : 내가 false로 모달 창 showmeintaskbar에 설정 한 경우

This.ShowInTaskbar = False; 
This.ShowInTaskbar = True; 

그러나, 양식 자체를 여기

이 호출 스택됩니다 닫습니다 !

Form_Load 메서드에서 폼 크기 조정 또는 위치 지정이 수행되는 경우에이 문제가 발생했습니다. 이 같은

// Set Size and location of items... 
this.MaximumSize = new System.Drawing.Size(1012, 665); 
this.MinimumSize = new System.Drawing.Size(1012, 665); 
this.MaximizeBox = false; 

또는 아무것도 : 모두이 같은 기동이 중 하나를 수행해야하는 경우

// Centre the main form to centre screen... 
this.Location = new Point((Screen.PrimaryScreen.Bounds.Size.Width/2) - (this.Size.Width/2), (Screen.PrimaryScreen.Bounds.Size.Height/2) - (this.Size.Height/2)); 

, 확인은 적절한 장소에서 이루어집니다. 나는에 나의 선호 :

Form1() 

방법을 바로 후 :

// Initialize Components... 
InitializeComponent(); 

방법. 이렇게하면 양식 아이콘이 나타나고 문제를 해결할 수 있습니다.

+0

양식의 '아이콘'이라고 말하면 해당 프로그램 창으로 전환 할 수있는 표준 프로그램 탭을 의미합니까? –

+0

Windows Forms 응용 프로그램 아이콘, 일반적으로 작업 표시 줄에있을 때 실행 아이콘. –

1

윈도우의 FormBorderStyle은 무엇입니까? 이 FixedToolWindow을의 경우,이 두 라인 내 폼로드 이벤트에서 작업 표시 줄

+0

고정 대화 상자 또는 고정 단일 – Pilouk

0

전환하여 ShowInTaskBar에 표시 실 거예요 : 윈도우 모달이 아닌 경우

그것은에만 작동합니다. 지금은 좋은 일입니다.

> EasyDeal.exe!EasyDeal.Windows.UI.FrmMenuSuivi.FrmMenuSuivi_FormClosing(Object sender, System.Windows.Forms.FormClosingEventArgs e) Line 382 Basic 
System.Windows.Forms.dll!System.Windows.Forms.Form.OnFormClosing(System.Windows.Forms.FormClosingEventArgs e) + 0x85 bytes 
System.Windows.Forms.dll!System.Windows.Forms.Form.CheckCloseDialog(bool closingOnly) + 0x8d bytes 
System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FContinueMessageLoop(int reason, int pvLoopData, System.Windows.Forms.NativeMethods.MSG[] msgPeeked) + 0x148 bytes 
System.Windows.Forms.dll!System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(System.IntPtr dwComponentID, int reason, int pvLoopData) + 0x1e9 bytes  
System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(int reason, System.Windows.Forms.ApplicationContext context) + 0x16c bytes 
System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoop(int reason, System.Windows.Forms.ApplicationContext context) + 0x61 bytes  
System.Windows.Forms.dll!System.Windows.Forms.Application.RunDialog(System.Windows.Forms.Form form) + 0x33 bytes  
System.Windows.Forms.dll!System.Windows.Forms.Form.ShowDialog(System.Windows.Forms.IWin32Window owner) + 0x38f bytes  
System.Windows.Forms.dll!System.Windows.Forms.Form.ShowDialog() + 0x7 bytes 
EasyDeal.exe!EasyDeal.Windows.UI.EasyDealCommon.ShowEasyDealForm(EasyDeal.Windows.UI.FormBase formToShow, EasyDeal.Windows.UI.FormBase formSender, Boolean closeFormSender, Boolean forceDialog) Line 2787 + 0xc bytes Basic