0
A
回答
0
我找到了解決辦法,我跟着本教程中,將C#到VB:http://blogs.microsoft.co.il/janiv/2009/09/20/embedding-and-communicating-with-the-macromedia-flash-player-in-wpf/
但最後,我成功地結束了只有30行代碼做什麼,我想在第一...
下面是從WinForm的用戶控制的代碼,WFFlashPlayer.vb:
Imports System.Windows.Forms
Namespace FlashAxControls
Partial Public Class WFFlashPlayer
Inherits UserControl
Public Sub New()
InitializeComponent()
AxShockwaveFlash.Base = "#"
AxShockwaveFlash.Movie = "#"
End Sub
End Class
End Namespace
在情況下,WFFlashPlayer.Designer.vb:
Namespace FlashAxControls
Partial Class WFFlashPlayer
''' <summary>
''' Required designer variable.
''' </summary>
Private components As System.ComponentModel.IContainer = Nothing
''' <summary>
''' Clean up any resources being used.
''' </summary>
''' <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
Protected Overrides Sub Dispose(disposing As Boolean)
If disposing AndAlso (components IsNot Nothing) Then
components.Dispose()
End If
MyBase.Dispose(disposing)
End Sub
#Region "Component Designer generated code"
''' <summary>
''' Required method for Designer support - do not modify
''' the contents of this method with the code editor.
''' </summary>
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(WFFlashPlayer))
Me.AxShockwaveFlash = New AxShockwaveFlashObjects.AxShockwaveFlash()
CType(Me.AxShockwaveFlash, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'AxShockwaveFlash
'
Me.AxShockwaveFlash.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.AxShockwaveFlash.Enabled = True
Me.AxShockwaveFlash.Location = New System.Drawing.Point(0, 0)
Me.AxShockwaveFlash.Margin = New System.Windows.Forms.Padding(0)
Me.AxShockwaveFlash.Name = "AxShockwaveFlash"
Me.AxShockwaveFlash.OcxState = CType(resources.GetObject("AxShockwaveFlash.OcxState"), System.Windows.Forms.AxHost.State)
Me.AxShockwaveFlash.Size = New System.Drawing.Size(1125, 825)
Me.AxShockwaveFlash.TabIndex = 0
'
'WFFlashPlayer
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.BackColor = System.Drawing.Color.FromArgb(CType(CType(239, Byte), Integer), CType(CType(239, Byte), Integer), CType(CType(242, Byte), Integer))
Me.Controls.Add(Me.SimpleButton1)
Me.Controls.Add(Me.AxShockwaveFlash)
Me.Name = "WFFlashPlayer"
Me.Size = New System.Drawing.Size(1125, 825)
CType(Me.AxShockwaveFlash, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
#End Region
Private AxShockwaveFlash As AxShockwaveFlashObjects.AxShockwaveFlash
End Class
End Namespace
這裏的WPF用戶控件,FlashPlayer.xaml.vb:
Imports System.Windows.Forms.Integration
Namespace FlashAxControls
Partial Public Class FlashPlayer
Inherits UserControl
Private Sub FlashPlayer_Loaded(sender As Object, e As RoutedEventArgs)
Dim host As New WindowsFormsHost()
Dim player As New WFFlashPlayer()
host.Child = player
FlashPlayerGrid.Children.Add(host)
End Sub
End Class
End Namespace
FlashPlayer.xaml:
<UserControl x:Class="FlashAxControls.FlashPlayer"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300" Loaded="FlashPlayer_Loaded">
<Grid x:Name="FlashPlayerGrid">
</Grid>
</UserControl>
最後,這裏是我的WPF應用程序的XAML代碼(一點點定製):
<dxr:DXRibbonWindow x:Class="MyProject.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
xmlns:dxr="http://schemas.devexpress.com/winfx/2008/xaml/ribbon"
xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
xmlns:controls="clr-namespace:FlashAxControls.FlashAxControls;assembly=FlashAxControls"
Title="MainWindow" Height="922" Width="1127" Background="#FFEFEFF2" ResizeMode="CanMinimize" BorderEffect="Default" IsAeroMode="False" DisplayShowModeSelector="False" WindowStyle="SingleBorderWindow" ShowInTaskbar="True">
<Grid>
<Grid HorizontalAlignment="Left" Grid.Row="1" Grid.ColumnSpan="2">
<controls:FlashPlayer Height="825" Width="1125"/>
</Grid>
</Grid>
</dxr:DXRibbonWindow>
我希望這可以幫助別人。
相關問題
- 1. 將PDF嵌入WPF應用程序
- 2. 將Flash/Flex組件嵌入到Java應用程序中
- 3. 在WPF應用程序中嵌入和迭代Flash電影
- 4. 在WPF應用程序中嵌入Flash影片
- 5. 將Flash應用嵌入到YouTube中
- 6. 將JPG圖像嵌入到WPF應用程序中的問題
- 7. 將Ogre嵌入到Qt應用程序
- 8. 將matplotlib嵌入到tkinter應用程序
- 9. 嵌入WPF應用程序中的Windows.Form
- 10. 在WPF應用程序中嵌入mozilla
- 11. 在WPF應用程序內嵌入Unity3D應用程序
- 12. 如何使Flash項目嵌入到桌面應用程序中?
- 13. 將Flex MXML應用程序移入Flash
- 14. 將Flash嵌入到Flash AS3中
- 15. 將VLC播放器嵌入WPF應用程序
- 16. 將Windows窗體嵌入WPF應用程序
- 17. DragManager將Flash應用程序加載到Flash應用程序時出現問題
- 18. 將java小程序嵌入到C#桌面應用程序中
- 19. Flash應用程序到iPhone
- 20. WPF。將DLL嵌入到EXE
- 21. 將Python嵌入iPhone應用程序
- 22. 將應用程序嵌入窗口
- 23. 將JasperReports嵌入Rails應用程序
- 24. 將tomcat嵌入Grails應用程序
- 25. 如何將C應用程序嵌入Java小應用程序
- 26. 將ember-cli應用程序嵌入另一個應用程序
- 27. 將桌面應用程序嵌入Windows 8應用程序
- 28. 將單軌應用程序嵌入另一個應用程序
- 29. 將Moneybookers集成到WPF應用程序
- 30. 是否可以將耙入嵌入到應用程序中?
您需要發佈一個**特定的**問題,然後才能更容易地使用**特定的**正確的答案來解決它。嘗試一些然後在卡住時也會問這裏添加問題代碼的代碼段。例如,看右邊的_Related_部分:[**在vb.net **中播放flash文件](https://stackoverflow.com/questions/13467108/playing-flash-file-in-vb-net? rq = 1) –
實際上,我一直堅持我可以重現這個應用程序的方式......我不知道哪些工具可以幫助我做所有我想要的事情,因爲我發現的大多數項目都有侷限性由於微軟許可證或其他事情。自從嘗試了大約3天以來,我一直在努力掙扎...我知道這是更好的具體,但實際上我不能更多。我知道如何在WinForms中嵌入Flash,問題是實現_customizable_功能區。而在WPF中則相反,功能區幾乎已經實現,但無法嵌入Flash。順便說一下,我更喜歡留在WinForms上。 – Meivyn
我終於設法在WPF中添加Flash,所以我會看看是否可以繼續爲我的項目,我會回來進一步的信息。我將用這個* specific *問題的解決方案編輯我的第一篇文章:p – Meivyn