久久久久久久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)用程序并單擊菜單條)
主站蜘蛛池模板: 国产成都精品91一区二区三 | 日韩在线欧美 | 亚洲一区 中文字幕 | www.婷婷| 天天干精品 | 成人亚洲精品 | 丁香婷婷久久久综合精品国产 | 久久综合一区二区 | 国产精品无码永久免费888 | 亚洲精品乱码久久久久久蜜桃 | 亚洲综合在线视频 | 久久国产精品色av免费观看 | 激情av免费看 | 国产一区二区麻豆 | 天色综合网 | 一级毛片在线播放 | 瑟瑟视频在线看 | 日韩在线小视频 | 爱爱视频在线观看 | 国产精品国产a级 | 性高朝久久久久久久3小时 av一区二区三区四区 | 欧美日韩一区二区在线观看 | www.久久.com| 亚洲深夜福利 | 国产成人精品免费视频 | 久久国产视频网 | 久久精品国产清自在天天线 | 久久久久久久久久久高潮一区二区 | 国产综合视频 | 日韩中文在线观看 | 人和拘一级毛片c | 99re国产精品 | 成人午夜免费视频 | 成年人网站免费 | 欧美一区二区三区视频 | 亚洲国产一区二区视频 | 国产一区在线免费观看视频 | 中文字幕在线观看精品 | 日韩在线一区二区三区 | 欧美一区二区在线 | 青青草久久 |