Wpf - Change Mediaelement Source Based On Actions?
Apr 15, 2011
I have a WPF 4 and VB.net 2010 project. I am playing videos in a single mediaelement. This is what I need to do:When the window first opens, I have the first video play just fine. However, it is after this video plays that I run into trouble figuring out how to do the following.I need the video source to change immediately following a single play through of any video, and I need this video (henceforth referred to as an "ambient" video) to loop forever.When a certain event happens, I need to change the video source again, have it play once through, and then go back to looping ambient video in step 1.Here is the rub, however. Many of the video triggers are inside of If-Then or Select Case statements in code behind, so I'm not exclusively using simple WPF events such as "MouseUp" or "MouseEnter".Also, all videos must play in the same mediaelement, for performance reasons.
I have a project that is WPF4 and VB.net. I'm trying to set a mediaelement's source using a mediatimeline (inside a storyboard construct), so I can loop the mediaelement. However, I cannot figure out how to set the source to a relative URI in WPF. I know how to do it in VB.net, but by setting the source there, I can't have the media looping.How do I set the source of a mediaelement in a mediatimeline to a relative URI?
I want to be able to change an image depending on what is selected in the drop down box. I have this JS code to change the image. Simplified of course.
<script type="text/javascript"> function changeImage() { var oDDL = document.all("ddlNAME"); var NAME= oDDL.options[oDDL.selectedIndex].text; switch(NAME) { [Code] .....
When I call this function I do it in my DDL implementation. <asp:DropDownList ID="ddlNAME" runat="server" OnTextChanged="changeImage()" >
But for some reason the changeImage() is not firing. It is giving me an error saying 'changeImage' is not a member of 'ASP.default_aspx'
I've got a datacontext and created a binding source using LINQ to sql but cannot filter said bindingsource. The supportsfilter of the bindingsource is set to false ? why ? I can't find any info to say that I cannot filter a binding source based on a linq query.[code]
I am developing a video player with WPF.(in VB)I have already created a MediaElement ,ListBox, "Next" button, then start playing through reading ListBox,and use "Next" to skip to next audio/video.In "MediaEnded" event, i just copy all code in "Next" button.Now, problem is coming,
Assume the Listbox has four audios(.mp3), "test1.mp3", "test2.mp3", ...... now playing is "test1.mp3", i push "Next" button, then now playing is "test2.mp3". However, when i just let "test1.mp3" play completed, my player will not play "test2.mp3",
It can fetch source properly but the problem is it fetch website source based on server from where script executed (i mean where website hosted), but i want to fetch content based on client information (ip etc)
I use Visual Studio 2010 and SQL Server 2008 R2. I have created an Entity Model in a class library which I have referenced in a VB Winforms project. I created a data source in the project based on the entity model in the dll. However, all columns in the data source are listed in alphabetical order instead of the native order from the SQL Server database. I cannot locate the cause of this as much as I try.
This might not seem a huge problem, but it is costing me valuable time in rearranging controls dragged to forms and reindexing their tabstop indexes.
I have an old system developed in Visual Basic. How can I determine what Visual Studio version to use based on the source code files? I've tried to upgrade the application using VS2005, VS2008 and VS2010. With VS2005 when I attempt to upgrade the source, it says the system was developed in a newer version. I currently have VS2005 version 8.0.50727.42 installed.
How to know HTML source change or not change because this web site written ASP.net and information is changing in TABLE tags when pressed button.I'm not reading when change the TABLE tags.
I have the Context Menu Options like ( Small Font , Large Font ) based on the selection I want to change the size of the Font in the Controls,Control's Size & location(x,y,height,width). The resize of the controls should not affect the look and feel of the forms.
I have a two forms with about 25 bound controls on each in the same solution. All of the data for both forms is in the same SQL table. I need to filter the data and only get the data appropriate to the called form. I consulted an University VB professor and he would only say "it won't be easy".
I tried removing all of the bindings and rebinding them to the new datasource but there were still some remnants (probably from the navigator) that proved illusive.
Is the only solution to recreate the VB forms and bind them to the new datasource?
(using Visual Studio 2008 Professional)
Private Sub HazMatlLabelsBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles HazMatlLabelsBindingNavigatorSaveItem.Click
I have two comboboxes. The data sorce of combobox1 is a list of string that is fixed.Combobox2's data sorce will be a list of string that depends on the selection of combobox1. This is very similar to a common case as follows: first enter your contry, then depending on your enter, the second combobox will show you the list of universities in the country.
'Change selection of first combobox Private Sub cbxClient_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbxClient.SelectedIndexChanged
I've got a function that's supposed to extract and return a 32x32px bitmap from a larger bitmap which has a set of 32x32 tiles inside it.
Here's the code I have now, but it's wrong since the Tile.GFX_Pos properties are telling it where in the destination image to draw, not where in the source image to draw from.
Overloads Shared Function TileGFX(ByVal SrcGFX As Bitmap, ByVal Tile As TileDef) As System.Drawing.Bitmap Try
[Code]....
So since this doesn't work, what I'm wondering is if anyone knows a good way to select where in the SrcGFX bitmap to blit from, instead of (as currently and incorrectly) selecting where in the destination bitmap to blit to.
I had built an application such like items management, I used two table in two different database in two different engine server, the stack is, when I want to make event for add new data, how I can make the event for the combobox ID for switching it's datasource from before.. for the knowledge, the first table is Xtable, database is Xdatabase and the machine is Xmachine; and for the second one is : table is Ytable, database is Ydatabase and the server machine is Ymachine...
I have a form with a large number of buttons on it, each named btn1 through btn25. I have another button that is generating a random number and saving it to an integer variable intDrawn.
I'd like to know if there's a simple way to alter a particular button based on the result in intDrawn; if intDrawn = 5, then I want to change the font in btn5, for example.
Is there a way to alter a control programmatically like this? I'm using Visual Basic Express 2008.
i have a code which has the connection string as driver. dim s as string = "Driver={SQL Server}; Server=xxxSQLEXPRESS; Database=dbRegister; Trusted_Connection=yes" i need to change that to - "data source=1.2.3.4;user id=xx;password=xxxxx;initial catalog=xxxxx;Connect Timeout=30" when i just change the text it gives this error - "[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified" how do i declare the datasource?
I think that changing from WinForms to WPF just because the blur effect is easier to do in WPF is the stupiest thing i can do right now it took me time to understand how the windows form application works i dont even how change the source of an image in WPF so here we are again. how to blur a speciefied image using CODE ONLY ?
See what im trying to do:
1. Imagine that you turn on your pc. takes some time to load. 2. Finally for the first time you are on the desktop. 3. Before you do something after every icon is loaded my program takes a picture of the desktop and blurs it. 4. then it runs fullscreen showing the desktop behind as blurred and not giving you access to the desktop. 5. a login/register border pops up 6. if you login the program closes if you dont it stays there waiting for you to login or register.
I wont use it that way im planning to do it on the startup of my program only blur the window not the screen (i mean the content of my window) untill you login or register then it clears again. What i need to learn:
1. How to take a screenshot of my program (only yhe content of the window) [Progress: 1% (cause i know how to take a screenshot of the desktop)]
2. How to blur that image [Progress: 100%]
No need for third party programs or dlls i mean isnt there a default function in vb.net the stupiest way to do it?
i have a code which has the connection string as driver.dim s as string = "Drr={SQL Server};Server=xxxSQLEXPRESS; Database=dbRegister; Trusted_Connection=yes"i need to change that to"data source=1.2.3.4;user id=xx;password=xxxxx;initial catalog=xxxxx;Connect Timeout=30"hen i just change the text it gives this error -"[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"
Is it possible to change the data source of a dropdown list in a gridview from another dropdown list selected index changed method in the same gridview?
for example I have a dropdown that needs to change its contents depending on what is chosen in the previous cell of the gridview, which is also a dropdown list.
I want to change the source data for my pivot table in Excel using VB.Net to a named range.
I have : table.ChangePivotCache(wb.PivotCaches.Create(SourceType:=Excel.XlPivotTableSourceType.xlDatabase, SourceData:=sheet.Names("name_of_NamedRange").RefersToRange))
Exception : The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))