2016-12-05 7 views
0

winform은 크기를 변경할 수 없습니다. 질겁 장치는 480 * 764입니다. 나는 디버깅하고 새로운 크기를 가지고 :WINCE winform은 크기를 변경할 수 없습니다.

debug

그러나 크기가 아직 변화를. 어떻게 된 거예요?

+0

FormBorderStyle을 sizable로 설정해야합니다. –

+0

@AdrianStanculescu : 대부분의 C# 개발자는 Windows CE에서 작업 할 때 Compact Framework를 사용하고 있습니다. 올바른 경우 CF에서 지원되는 유일한 테두리 스타일은 None, FixedSingle 및 FixedDialog입니다. – AlainD

+0

2a4b8c2b : .NET 2.0 또는 3.5의 Compact Framework 버전을 사용하는 경우 질문에 추가하거나 태그를 추가하십시오. – AlainD

답변

0

Load 이벤트가 아닌 생성자에 크기 조정 코드를 삽입 해보십시오. FormBorderStyle이 크기가 필요하다고 생각하지 마십시오 (사용중인 것으로 가정되는 .NET Compact Framework에서도 지원됩니까?). 양식의 형식은 FixedDialog입니다. 양식을 가운데에 배치해야하는 경우 크기를 설정 한 직후에 전화하는이 도우미 기능을 사용할 수 있습니다.

public static void SetFormPosition(Form frmChild) 
{ 
    // Set the form position on the Windows CE panel 
    if (frmChild != null) 
    { 
     // Get the size of the screen (should be 480x768) 
     Rectangle rctScreen = Screen.PrimaryScreen.WorkingArea; 

     // Now calculate the position of the form 
     int nPosX = ((rctScreen.Width - frmChild.Width)/2); 
     int nPosY = ((rctScreen.Height - frmChild.Height)/2); 

     // Set the position 
     frmChild.Location = new Point(nPosX, nPosY); 
    } 
} 
관련 문제