|
I didn't know there was such a thing. If you can play any track how you want in Windows Media Player, you can then use it's control to do it inside your app.
|
|
|
|
|
I've tried Windows Media Player and DirectX.AudioVideoPlayback, both played the video fine, but also played all the audio tracks at the same time.
You can't choose one sigle audio track in a multi-track avi file with WMP (Not even with WMP 11)
|
|
|
|
|
Ok, I've found a way to do it.
First of all you have to install a DirectShow filter to 'separate the audio tracks'
I've used Morgan Stream Switcher filter (freeware)
And then:
Dim iControl As WMPLib.IWMPControls3 = WMP.Ctlcontrols 'WMP.Controls if you didn't embeded the object
icontrol.currentAudioLanguageIndex = track 'Where track is the audio track index.
And thats all.
|
|
|
|
|
Hi, I'm helping a colleague of mine.
We're trying to create an Excel workbook so he can do some calculations. However, we can't get the excel object to instantiate. We've added the reference via 'Project->Add Reference->Microsoft Excel 11.0 Object Library->OK.
On our form, we've added the following but can not get the object to instantiate.
Imports Microsoft.Office.Interop.Excel
Public Class Form1
Dim excelapp As New Microsoft.Office.Interop.Excel.Application
Dim excelwb As Microsoft.Office.Interop.Excel.Workbook
End Class
The Dim calls seem to take ok as no squiggly lines appear on those two lines.
Attempting to reference excelapp or excelwb only results in squiggly lines under their names and no properties will appear in the drop down - that is, there is no dropdown as it doesn't recognize the two variables.
How can we instantiate the excel object so we can use the methods on it?
Thanks in advance.
|
|
|
|
|
I tried the following;
Imports Microsoft.Office.Interop.Excel
Public Class Form1
Dim excel As New Microsoft.Office.Interop.Excel.Application
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
excel.Visible = True
End Sub
End Class
And excel application opens fine and becomes visible when Form1 loads.
If you put excel.visible in your form load event as a test does that work?
|
|
|
|
|
Ah, I see what we did. We were trying to invoke methods on the vars without being inside a form-method.
(I'm not a VB.NET developer. Can you tell!?) :P
Thank you very much for your help!!
|
|
|
|
|
I am using MS SQL as my database.
To display my data in a datagrid i used the SqlDataAdapter, SqlConnection and its DataSet to connect to my database.
When i preview my data through the SqlDataAdapter its just fine.
But this will not work for the datagrid.
I used
jesSqlDataAdapter.Fill(jesDataSet1)
or
jesSqlDataAdapter.Fill(jesDataSet1, "Table_Name")
in the form/datagrid load sub.
However i get an error:
An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in system.data.dll
Additional information:System error.
Please help.
|
|
|
|
|
From the very limited information you provided, it looks like the SQL query you tried to run isn't valid, or how you setup the query to execute isn't correct.
|
|
|
|
|
Below is the query
SELECT AccountNum, LastName, FirstName, PolicyNumber, Premium
FROM INSURE_TABLE
This is query in the Data Adapter Configuration Wizard.
|
|
|
|
|
OK. That leaves the code you have to setup and execute the query. Something isn't right, either from how you setup the connection, like connection string and SqlConnection objects, down to setting up the SqlDataAdapter. Without seeing that code, there isn't much we can tell you.
|
|
|
|
|
Which other code are you requesting?
The only code i have is the one in the Form_Load with reads:
jesSqlDataAdapter.Fill(jesDataSet1)
or
jesSqlDataAdapter.Fill(jesDataSet1, "Table_Name")
I used the data wizards to configure the dataadapter and dataset.
I chose the Microsoft OLE DB Provider for SQL Server at the Data Link Properties.
|
|
|
|
|
Hi,
Thanks to Dave Kreskowiak who guided me to use Backgroundworker. It is a fantastic feauture. However I have experienced a difficulty to run the class what handles the background processing via backgroundworker control. I have received the following error message. If you know the solution, I would like to know also.
Thanks.
Cross-thread operation not valid: Control 'Archive' accessed from a thread other than the thread it was created on.
The scenerio is a simple task as described here: I created a class. The class inherits from a form and produces a listview and then assigns it to a property variable. There is two progress bar which are used to show the progress while reading the records. This class is called by the application inside a sub procedure. The main form is calling the class.
'APPLICATION FORM1
<STAThread()> _
Public Sub LoadArchiveFiles()
Dim myApp As New Loadarchive
myApp.FileName = ArchiveDirectory
'
ListView1 = myApp.NewListview
ToolStripStatusLabel1.Text = myApp.StatusMessage
End Sub
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
OK. The problem I wanted to avoid, you stumbled into. You cannot touch a UI control from a thread other than the one that created the control. So, that means you can't directly interact with the ToolStripStatusLabel from the code that is running in the BackgroundWorker.
I can't tell you how to do it right now, because I'm short on time, but if you do the research yourself, you're Googling for "VB.NET Delegate Invoke Thread".
|
|
|
|
|
Hi All,
How can i develop Barcode True Type Font.Please give me some idea about it.
Thanks
Best Regard
Anubhava Dimri
mailto: anubhava.prodata@gmail.com
|
|
|
|
|
You could just download one from here[^]
Simon
|
|
|
|
|
And this has what to do with VB.NET??
|
|
|
|
|
I have a Collections.Generic.List object which contains two fields:
Reference Amount<br />
--------- ------<br />
101223 100.00<br />
125567 200.00<br />
101223 110.00<br />
134225 300.50<br />
125567 116.00
I want to group these into another list to give
Reference Amount<br />
--------- ------<br />
101223 210.00<br />
125567 316.00<br />
134225 300.50
How can I do this please?
|
|
|
|
|
Well, with the object model you've chosen, you have little choice but to go through each item in your collection and generate a second collection with the totals. The basic idea is to see if a Reference number is in a collection, and if not, add it with the current Amount. If it already exists in the collection, you get the existing total from that collection, add the Amount to it, then put the new total back in the collection. You'd probably use a HashTable, or some other Key/Value pair collection, to store the totals.
|
|
|
|
|
i've a datagridview control populated with records from database.
i've formatted certain cells of datagridview according to a condition.
(i mean i've set the fore color and back color of cell).
But when i export these datagridview contents to excel 2003, no cell colors will be
appearing.pls help me.
i'm developing desktop application with vb.net 2008 and excel 2003.
Thanks in advance.
|
|
|
|
|
Never done this but I feel you will need to write code for this using Interop.
The word "politics" describes the process so well: "Poli" in Latin meaning "many" and "tics" meaning "bloodsucking creatures."
जय हिंद
|
|
|
|
|
You will have to go through each cell in your datagrid and set the colors in the Excel sheet yourself. Warning! This will be a slow process! You cannot do this through a CSV file, so if that's the method you're using, it won't work.
|
|
|
|
|
Hi,
i'm iterating through each cell of dataset table and writing it to excel using interop services.pls tell me how to do it?
|
|
|
|
|
I don't know the Excel object model off the top of my head, but I think you might be looking for a FillColor, or BackColor, or maybe a ColorIndex property. I seem to remember something about an Interior property that this may fall under.
Oh, wait. A quick Google for "vb excel cell background color" reveals a plethora of information[^].
|
|
|
|
|
I use this code. It copies the grid into excel as you see it in the vb app color and all formatting.
Response.Clear()
Response.AddHeader("content-disposition", "attachment;filename=FileName.xls")
Response.Charset = ""
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.ContentType = "application/vnd.xls"
Dim stringWrite As New System.IO.StringWriter()
Dim htmlWrite As New HtmlTextWriter(stringWrite)
GridView1.RenderControl(htmlWrite)
Response.Write(stringWrite.ToString)
Response.End()
Chilly442
|
|
|
|
|
Hi
I need the code for windows application(desktop).i'm using vb.net 2008 with msexcel 2003.
Thanks in advance.
|
|
|
|