我可以编写代码来“还原”吗? Silverlight托管页面。 [英] Can I write code to "Restore Down" Silverlight hosting page.

查看:71
本文介绍了我可以编写代码来“还原”吗? Silverlight托管页面。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家都在Code Project,

是否可以编写代码来自动恢复托管页面以适应托管应用程序的维度。从Microsoft网站有以下代码(VB)我只想设置主页的高度和宽度,但由于我是初学者,我不知道我需要什么以及如何将其应用到我的代码中。

任何人都可以提供帮助。

亲切的问候

意志。



Hi all at Code Project,
Is it possible to write code to automatically "Restore Down" a hosting page to fit the dimensions of the hosted application. From the Microsoft website there is the following code (VB) I only want to set the height and width of the host page but as I am a beginner I don''t know exactly what I need and how to apply it into my code.
Can anybody help.
Kind Regards
Will.

'Declaration
Public Event Resized As EventHandler









Private WithEvents rootPage As Page = New Page()

Private WithEvents htmlContent As Content

Private Sub Application_Startup(ByVal o As Object,ByVal e As StartupEventArgs)处理Me.Startup

Me.RootVisual = rootPage

htmlContent = Me。 Host.Content

End Sub



Private Sub ToggleFullScreen(ByVal sender As Object,_

ByVal e As MouseButtonEventArgs)处理rootPage.MouseLeftButtonDown

Me.Host.Content.IsFullScreen = Not Me.Host.Content.IsFullScreen

End Sub



Private Sub DisplaySizeInformation(_

ByVal sender As Object,ByVal e As EventArgs)_

处理htmlContent.FullScreenChanged,htmlContent .Resized



Dim message As String = String.Format(_

ActualWidth = {0},ActualHeight = {1}, _

Me.Host.Content.ActualWidth,_

Me.Host.Content.ActualHeight)



rootPage.LayoutRoot.Children.Clear()

Dim t As New TextBlock()

t.Text = message

rootPage.LayoutRoot.Children .Add(t)



结束Sub





Private WithEvents rootPage As Page = New Page()
Private WithEvents htmlContent As Content
Private Sub Application_Startup(ByVal o As Object, ByVal e As StartupEventArgs) Handles Me.Startup
Me.RootVisual = rootPage
htmlContent = Me.Host.Content
End Sub

Private Sub ToggleFullScreen(ByVal sender As Object, _
ByVal e As MouseButtonEventArgs) Handles rootPage.MouseLeftButtonDown
Me.Host.Content.IsFullScreen = Not Me.Host.Content.IsFullScreen
End Sub

Private Sub DisplaySizeInformation( _
ByVal sender As Object, ByVal e As EventArgs) _
Handles htmlContent.FullScreenChanged, htmlContent.Resized

Dim message As String = String.Format( _
"ActualWidth={0}, ActualHeight={1}", _
Me.Host.Content.ActualWidth, _
Me.Host.Content.ActualHeight)

rootPage.LayoutRoot.Children.Clear()
Dim t As New TextBlock()
t.Text = message
rootPage.LayoutRoot.Children.Add(t)

End Sub

推荐答案

你有答案: http://social.msdn.microsoft.com/Forums/en-US/silverlightstart/thread/d529b037-2db5-481f-ae1b-12c7cb1b9fec [ ^ ]



最好的问候。
You have the answer here: http://social.msdn.microsoft.com/Forums/en-US/silverlightstart/thread/d529b037-2db5-481f-ae1b-12c7cb1b9fec[^]

Best Regards.


这篇关于我可以编写代码来“还原”吗? Silverlight托管页面。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆