|
The windows Media Player control is probably what you mean, you may need to add it to the toolbox.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I was wondering the same thing, but you can't add the media player control to the toolbox.
|
|
|
|
|
Why not? It works for me.
It's as easy as right-clicking the ToolBox and picking "Add/Remove Items..." under VS.NET 2002 and 2003 or "Choose Items..." under VS.NET 2005. A dialog opens up, click on the COM tab, find Windows Media Player in the list, put a check mark next to it and hit OK. Standard stuff for any COM-based component...
You've been giving out a bunch of bad advise. How long have you been doing this?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
You can add the Windows Media Player control to the ToolBox by doing this[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Im not sure if windows media player and MMControl are the same thing. Cos i found a tutorial on adding sound recording to vb.net program and it used MMControl for recording sound....
|
|
|
|
|
True, but that's about as close as you're going to get without installing VB6.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I hope I don't insult anyone but I am trying to get any (if any) help developing for DocuCorp Product specifically the Documanager. THe company I work for currently is trying to migrate the thin client application design by the vendor(Docucorp) to upload and store files in this server. the problem is that this so call thin client was desing in believe or not using dynamic HMTL + a pseudo ASP calls. They provided documentation how to use their so call COM objects (and again believe or not i think they are vb5 or vb6) base code. We are tying to migrate this whole obsolete architecture to a more strong and robuted concept desing but so far nothing. Found out that their vb? libraries are not .NET interop which makes my project even difficult to get it going.
Has anyone out there done anything with any Docucorp product?
Just wonder
Thanks
Tony
|
|
|
|
|
Never heard of it. Truthfully, it's very unlikely someone with any experience with the product will see your post. In a few days, your post won't even be on the first page of the forum. Your best source of information on 3rd party controls is going to be the manufacturers own support site, Docucorp Support[^]
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thanks Dave, Being there done that!
Tony Matute
|
|
|
|
|
I get it. It makes you wonder why some companies even charge for their libraries.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I'm writing a program that requires the user to choose either a single(or multiple) files or a whole folder. Is there a dialog for something like this. I know of the FolderBrowserDialog and OpenFileDialog but can I do this type of thing with either of those, I've tried but maybe I'm doing it wrong. Any help regarding this issue would be greatly appreciated, whether it be actual code or guide me to a site (or somewhere) for some more information. Thank you in advance!!
PS. If it matters at all, I am using VisualStudio.NET 2003
|
|
|
|
|
i believe with OpenFileDialog you can change the setting to either be single or multiple. it won't do the whole folder for you but if you do a ctrl-A (select all) i guess that's the same thing. it obviously won't handle sub folders.
|
|
|
|
|
Thanks for responding. I figured there wasn't an actual dialog that could do that but I thought I'd ask. Thanks again.
|
|
|
|
|
Hello,
I need export big texts of the my DataBase to MS Word, I using field of the DataBase in "Text" Format.
This is code I using:
==========================================================================
Dim varDR_DataReader As OleDbDataReader
objWord = CreateObject("Word.Application")
objWord.Documents.Open(Directory.GetCurrentDirectory & "\NewDoc.doc")
ReplaceVariable("@Book", varDR_DataReader ("Field_Book"))
ReplaceVariable("@Page", varDR_DataReader ("Field_Page"))
ReplaceVariable("@Description", varDR_DataReader ("Field_Description"))
objWord.visible = True
varDr_DataReader.Closed
Private Sub ReplaceVariable(ByVal Achar As String, ByVal Repl As String)
With objWord.Selection.Find
.Text = Achar.ToString
.Replacement.Text = Repl.ToString
.Forward = True
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
While .Execute = True
objWord.Selection.Select()
System.Windows.Forms.Clipboard.SetDataObject(Substituir)
objWord.Selection.Paste()
End While
End With
End Sub
===========================================================================
But, Field_Description it's very big, and caused overflow in ReplaceVariable.
Help me, please...
Thank's
Plinio
-- modified at 13:11 Friday 3rd November, 2006
|
|
|
|
|
hi, ive been trying to edit the global.aspx file to create an application connection to the SQL Server.
Code
<%@ Application Language="VB" %>
<%@ Import Namespace="System.Data.SQLCLIENT" %>
<%@ Import Namespace="System.Data" %>
<script runat="server">
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
' Code that runs on application startup
Dim sqlConn As New SqlClient.SqlConnection
Dim sqlCommand As New SqlClient.SqlCommand
Dim ConectStr As String = "Data Source=DEVELOPMENT\SQLEXPRESS;Initial Catalog=Testdata;Integrated Security=True"
sqlConn = New SqlClient.SqlConnection("ConectStr")
sqlConn.Open()
Application("SQLConnection") = sqlConn
End Sub
Any ideas where im going wrong as this keeps failing.
Thanks in advance
I really do need help..... all this computer stuff is way over my head !!
|
|
|
|
|
You've got multiple problems with this.
First, ApplicationStart only executes the first time a page request is made to your site. It will never execute again.
Second, since this only executes once, anything this code does will never get executed for any subsequent page requests. Since web applications are stateless, your page code has to be written so that each page requests builds and destroys the objects it needs on EVERY request, not just the first one.
Any object you create in ApplicationStart will fall out of scope and not be usable anywhere in your page's code. So, building an SQL connection in ApplicationStart will not do you any good since they will no longer exist after ApplicationStart is done executing.
Lastly, you REALLY have to be specific in your posts as to what the code is supposed to be doing and supply any and all error messages you get along with the lines of code that the errors occur on. Without that, all you've done is pulled your car into the dealership and told the service guy "It's broke." How's he supposed to know what you're talking about?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi,
I'd like to know how i can add all the file names of pictures in a directory to a listbox, and adding their extension in a column at the right of the file names. Anyone knows how to do this? (Sample code pls? )
--Zaegra--
|
|
|
|
|
Dim files() As String = IO.Directory.GetFiles(PathToDirectory)
|
|
|
|
|
I used a listview. I don't like the multi column behavior of a listbox. If you want to go through sub directories as well there is more to it obviously
1) Setup a listview
2) make sure you change it's 'view property to 'detail'
3) edit columns. add 2 call and them "File Name" and "Extension"
4) include the code below to populate it.
Imports System.IO
Public Class Form2
Private Sub Form2_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim oItem As ListViewItem
For Each sFile As String In Directory.GetFiles("c:\picturePath")
oItem = New ListViewItem(Mid(sFile, InStrRev(sFile, "\") + 1).ToLower)
oItem.SubItems.Add(Mid(sFile, InStrRev(sFile, ".") + 1))
Me.ListView1.Items.Add(oItem)
oItem = Nothing
Next
End Sub
End Class
|
|
|
|
|
Thanx, but is there a way to only display image file names in the list? The code you gave me adds all files in a dir
--Zaegra--
|
|
|
|
|
sure you just need to apply a filter
Imports System.IO
Public Class Form2
Private Sub Form2_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim oItem As ListViewItem,sExt as string
For Each sFile As String In Directory.GetFiles("c:\picturePath")
sExt = Mid(sFile, InStrRev(sFile, ".") + 1).tolower()
Select case sExt
case "bmp","gif","tif","jpg","jpeg" 'etc.
oItem = New ListViewItem(Mid(sFile, InStrRev(sFile, "\") + 1).ToLower)
oItem.SubItems.Add(sExt)
Me.ListView1.Items.Add(oItem)
oItem = Nothing
case else
'ignore file
end select
Next
End Sub
End Class
|
|
|
|
|
I have a function that should format a alpha numeric partnumber but it doesnt always work. not sure what i am missing here.
I have the partnumber defined as LONG , which only works on numeric part numbers. However, when I change it to a STRING the function throws an error "Unable to cast object of type 'System.String' to type 'System.IFormatProvider'.". Any advice would be greatly appreciated.
sample data that would be passed into the function follows
partnumber = 1243bu format= ##-###
Code:
Public Function FormatPartNumber(ByVal formatstyle As String, ByVal partnumber As String) As String
'FormatPartNumber = String.Format(formatstyle, partnumber)
Return partnumber.ToString(formatstyle)
End Function
jds1207
|
|
|
|
|
Imports System.IO
Public Class Form2
Private Sub Form2_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
MsgBox(FormatPartNumber("00-000", "3aA33A"))
End
End Sub
Public Function FormatPartNumber(ByVal formatstyle As String, ByVal partnumber As String) As String
If IsNumeric(partnumber) Then Return CLng(partnumber).ToString(formatstyle)
If partnumber.Length < formatstyle.Length Then partnumber.PadLeft(formatstyle.Length, "0")
Dim sFormatted As String = String.Empty
Dim iFPos As Int16 = formatstyle.Length, iPPos As Int16 = partnumber.Length
Do While iFPos > 0
If Mid(formatstyle, iFPos, 1) = "0" Then
sFormatted = Mid(partnumber, iPPos, 1) & sFormatted
iPPos -= 1
iFPos -= 1
ElseIf Mid(formatstyle, iFPos, 1) = "-" Then
sFormatted = "-" & sFormatted
iFPos -= 1
End If
Loop
If iPPos > 0 Then
Do While iPPos > 0
sFormatted = Mid(partnumber, iPPos, 1) & sFormatted
iPPos -= 1
Loop
End If
Return sFormatted
End Function
End Class
|
|
|
|
|
Getting the following error: Conversion from string "0022BU" to type 'Long' is not valid.
Any suggestions!
|
|
|
|
|
did you use my code as is? the 2nd argument is type 'string'.
this line should of caught that
If IsNumeric(partnumber) Then Return CLng(partnumber).ToString(formatstyle)
if it's not numeric then it will positionally replace the format with the value.
|
|
|
|