1

W8 と C# には、何らかの理由で実行できない単純なタスクがあります。プログラムで WebBrowser の高さをビューの高さと等しくしたい (私はドック プロパティを使用して VS2008 でこのタスクを実行できました) 私は試しました:

MainPage mainView = new MainPage();
webBrowser1.Height = mainView.WindowHeight;

これを行う理由は、デバイスを 720x1280 に変更すると、ビューの高さが拡大されますが、webbroswer コントロールは同じ高さのままになるためです。ヘルプやコードの提案は素晴らしいでしょう。ありがとう。

4

1 に答える 1

0

これを試して:

    WebBrowser webBrowser1 = new WebBrowser();
    public MainPage()
    {
        InitializeComponent();

        this.Loaded += delegate
        {
            webBrowser1.Height = this.ActualHeight;

            //if you want to add the web browser to main page,uncomment the next line.
            //this.LayoutRoot.Children.Add(webBrowser1);
        };
    }

これがあなたを助けることを願っています。

于 2013-04-01T07:45:17.427 に答える