0
私のwinformはサイズを変更できません。 winceデバイスは480 * 764です。私は、デバッグおよび新しいサイズました:WINCE winformはサイズを変更できません
しかし、サイズはまだ変わらないし。何が起こった?
私のwinformはサイズを変更できません。 winceデバイスは480 * 764です。私は、デバッグおよび新しいサイズました:WINCE winformはサイズを変更できません
しかし、サイズはまだ変わらないし。何が起こった?
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);
}
}
FormBorderStyleをsizableに設定する必要があります。 –
@AdrianStanculescu:ほとんどのC#開発者は、Windows CEで作業するときにCompact Frameworkを使用しています。正しい場合、CFでサポートされている唯一の境界線スタイルは、None、FixedSingle、およびFixedDialogです。 – AlainD
2a4b8c2b:.NET Framework 2.0または3.5のCompact Frameworkバージョンを使用している場合は、質問にそのタグを追加するか、タグを追加してください。 – AlainD