久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

WPF c# webbrowser 在頂部菜單上滾動(dòng)

WPF c# webbrowser scrolls over top menu(WPF c# webbrowser 在頂部菜單上滾動(dòng))
本文介紹了WPF c# webbrowser 在頂部菜單上滾動(dòng)的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我有一個(gè)帶有菜單和滾動(dòng)查看器的網(wǎng)格.在滾動(dòng)查看器中,我有一個(gè)帶有另一個(gè)網(wǎng)格和 webbrowser 元素的 groupbox.

I have a grid with a menu and a scrollviewer inside. In the scrollviewer i have a groupbox with another grid and inside a webbrowser element.

現(xiàn)在,當(dāng)我使窗口小于瀏覽器內(nèi)容的內(nèi)容并在滾動(dòng)查看器中向下滾動(dòng)時(shí),問題就出現(xiàn)了.一切都有一個(gè)邊距,所以它保持在頂部菜單的下方,但是 webbrowser 元素沒有,因此覆蓋了菜單.有沒有辦法解決這個(gè)問題?我想不通 :s Margins &填充不起作用.我希望它周圍的網(wǎng)格元素或其他東西可以解決問題,但沒有任何效果.

Now the problem arises when i make my window smaller than the content of my webbrowser content, and scroll down in the scrollviewer. Everything has a margin so it stays below the top menu, however the webbrowser element does not, hence covering the menu. Is there a way to solve this? I can't figure it out :s Margins & Paddings don't work. I was hoping the grid element around it or something would do the trick, but nothing works.

好的,我嘗試添加 xaml 代碼,但請(qǐng)記住它非常龐大,所以這是極短的版本:(webbrowser 元素位于代碼的底部)

Ok I tried to add the xaml code but bear in mind it was insanely huge, so this is the extreme short version: (webbrowser element is at the bottom of the code)

<Window x:Class="Cleaning_Masters_Official.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Cleaning Masters Offerte Packet - nieuw.off" Name="Main"  Width="{DynamicResource {x:Static SystemParameters.MaximizedPrimaryScreenWidthKey}}"
        Icon="binDebugImagesMain.ico"
    Height="{DynamicResource {x:Static SystemParameters.MaximizedPrimaryScreenHeightKey}}" Closing="Main_Closing"
    WindowStartupLocation="CenterScreen" WindowStyle="SingleBorderWindow" WindowState="Maximized">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="22" />
            <RowDefinition Height="*" />
            <RowDefinition Name="rowbar" Height="0" />
        </Grid.RowDefinitions>

        <ScrollViewer Margin="10" Grid.Row="1">
            <TabControl Name="tabChapters">

                <TabItem Header="Algemeen" Name="tabGeneral">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="auto" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>

                        <GroupBox Header="Configureer hoofdstukken:" Margin="10" Padding="10">
                            <Grid>
                                ...     
                            </Grid>
                        </GroupBox>

                        <GroupBox Header="Voorpagina Afbeeldingen:" Margin="10,0,10,10" Padding="10" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2">
                            <Grid VerticalAlignment="Top">
                                ...     
                            </Grid>
                        </GroupBox>

                        <GroupBox Header="Offerte Info:" Margin="10,10,10,10" Padding="10" Grid.Column="1" Grid.Row="0">
                            <Grid>
                                ...     
                            </Grid>
                        </GroupBox>

                        <GroupBox Margin="0,10,10,10" Header="Inhoudstafel:" Grid.Column="2" Grid.RowSpan="2">
                            <Grid>
                                <WebBrowser Margin="10" Name="wbInhoudstafel"/>
                            </Grid>
                        </GroupBox>
                    </Grid>
                </TabItem>

                <TabItem Header="1. Voorwoord" Name="tabVoorwoord">
                </TabItem>
                    ...         
                </TabItem>
            </TabControl>
        </ScrollViewer>

        <Menu DockPanel.Dock="Top" Name="TopMenu">
            ...     
        </Menu>

        <StatusBar Name="sbar" Grid.Row="2"
            ...     
        </StatusBar>
    </Grid>
</Window>

推薦答案

WPF WebBrowser 控件基本上是舊的 Win32 Webbrowser 控件,并且在技術(shù)上呈現(xiàn)在 WPF 內(nèi)容之上.此外,它在尺寸計(jì)算方面存在一些嚴(yán)重問題.

The WPF WebBrowser control is basically the old Win32 Webbrowser control and is technically rendered above the WPF content. Additionally it has some serious issues with size calculations.

見http://msdn.microsoft.com/en-us/library/aa970688(v=vs.85).aspx

恐怕沒有辦法告訴 WebBrowser 控件更改該行為.

I'm afraid there's no way to tell the WebBrowser Control to change that behavior.

但是還有其他控件可供選擇:

But there are alternative controls out there:

http://wpfchromium.codeplex.com/

http://awesomium.com/

在 SO 上找到了一個(gè)很好的總結(jié),其中指出了一些替代方案:

Found a great summary here on SO which points to some alternatives:

WPF WebBrowser (3.5 SP1) 總是在最前面 - 在 WPF 中顯示 HTML 的其他建議

這篇關(guān)于WPF c# webbrowser 在頂部菜單上滾動(dòng)的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

Right-click on a Listbox in a Silverlight 4 app(右鍵單擊 Silverlight 4 應(yīng)用程序中的列表框)
C# Console app - How do I make an interactive menu?(C# 控制臺(tái)應(yīng)用程序 - 如何制作交互式菜單?)
How to add an icon to System.Windows.Forms.MenuItem?(如何向 System.Windows.Forms.MenuItem 添加圖標(biāo)?)
How to avoid duplicate form creation in .NET Windows Forms?(如何避免在 .NET Windows Forms 中創(chuàng)建重復(fù)的表單?)
Building a database driven menu with ASP.NET, JQuery and Suckerfish(使用 ASP.NET、JQuery 和 Suckerfish 構(gòu)建數(shù)據(jù)庫驅(qū)動(dòng)的菜單)
UI Automation Control Desktop Application and Click on Menu Strip(UI自動(dòng)化控制桌面應(yīng)用程序并單擊菜單條)
主站蜘蛛池模板: 最新中文字幕在线 | 日韩av一区二区在线观看 | 99精品热视频 | 蜜桃视频在线观看免费视频网站www | 亚洲成人一区二区三区 | 亚洲综合二区 | 久久久精品视频一区二区三区 | 成人免费视频观看视频 | 久久综合av | 天天干天天干 | 久久综合av| 二区不卡 | 伊人伊成久久人综合网站 | 精品一区二区三区在线观看国产 | 本道综合精品 | 99资源| 日韩一区二区久久 | 做a视频在线观看 | 国产三级在线观看播放 | 福利av在线 | 久久免费视频在线 | 成人在线播放网址 | 国产剧情一区 | 日本在线精品视频 | 少妇精品久久久久久久久久 | 中文字字幕一区二区三区四区五区 | 精品免费 | 精品国产一区二区三区久久 | 久久精品国产99国产精品 | 欧美日韩在线免费 | 中文字幕电影在线观看 | 黄色香蕉视频在线观看 | 久久精品免费观看 | 国产色爽 | 国产99免费| 91婷婷韩国欧美一区二区 | 色播视频在线观看 | 超碰人人做 | 在线观看中文字幕dvd播放 | 免费在线观看一区二区 | 一区二区中文 |