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

WPF c# webbrowser 在頂部菜單上滾動

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

問題描述

我有一個帶有菜單和滾動查看器的網(wǎng)格.在滾動查看器中,我有一個帶有另一個網(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)在,當我使窗口小于瀏覽器內(nèi)容的內(nèi)容并在滾動查看器中向下滾動時,問題就出現(xiàn)了.一切都有一個邊距,所以它保持在頂部菜單的下方,但是 webbrowser 元素沒有,因此覆蓋了菜單.有沒有辦法解決這個問題?我想不通 :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 代碼,但請記住它非常龐大,所以這是極短的版本:(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 控件,并且在技術上呈現(xiàn)在 WPF 內(nèi)容之上.此外,它在尺寸計算方面存在一些嚴重問題.

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 上找到了一個很好的總結(jié),其中指出了一些替代方案:

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

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

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

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

相關文檔推薦

Right-click on a Listbox in a Silverlight 4 app(右鍵單擊 Silverlight 4 應用程序中的列表框)
C# Console app - How do I make an interactive menu?(C# 控制臺應用程序 - 如何制作交互式菜單?)
How to add an icon to System.Windows.Forms.MenuItem?(如何向 System.Windows.Forms.MenuItem 添加圖標?)
How to avoid duplicate form creation in .NET Windows Forms?(如何避免在 .NET Windows Forms 中創(chuàng)建重復的表單?)
Building a database driven menu with ASP.NET, JQuery and Suckerfish(使用 ASP.NET、JQuery 和 Suckerfish 構(gòu)建數(shù)據(jù)庫驅(qū)動的菜單)
UI Automation Control Desktop Application and Click on Menu Strip(UI自動化控制桌面應用程序并單擊菜單條)
主站蜘蛛池模板: 国产欧美日韩视频 | 性色av一区| 国产寡妇亲子伦一区二区三区四区 | 伊人久久久 | 国产普通话对白 | 婷婷一区二区三区 | 超碰人人射 | 天天插天天透 | 日日夜夜噜 | 国产成人99久久亚洲综合精品 | 亚洲a视频 | 三级黄网站| 免费一级片 | 激情五月激情综合网 | 看免费毛片 | 综合激情网| 日韩精品在线观看视频 | 日本亚洲天堂 | 成人免费在线观看 | 国产精品福利视频 | 死神来了4无删减版在线观看 | 欧美做受喷浆在线观看 | 国产精品伦子伦免费视频 | 99国产在线视频 | 一区二区三区av | 老司机免费福利视频 | 久久免费看视频 | 亚洲成人免费在线观看 | 欧美高清视频在线观看mv | a级黄色片| 欧美日韩高清在线 | 久久99久久久 | 亚洲欧美第一页 | av三级在线观看 | 怡红院久久 | 狠狠狠狠干 | 亚洲精品免费在线观看 | 日本视频一区二区三区 | 久热精品在线 | 国产亚洲在线 | 欧美视频免费 |