|
Originally, you asked how to beep on alert. Question answered.
If you want to play a WAV file, use the following (modified from version in Help)
<br />
Dim player As New SoundPlayer<br />
<br />
Try<br />
' Assign the selected file's path to the SoundPlayer object.<br />
player.SoundLocation = "C:\Program Files\NetMeeting\TestSnd.wav"<br />
<br />
' Load the .wav file.<br />
player.Load()<br />
player.Play()<br />
Catch ex As Exception<br />
SendToLogText(ex.Message)<br />
End Try<br />
|
|
|
|
|
|
There is another way with Visual Studio 2005 that is really easy:
My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Beep)
or
My.Computer.Audio.Play("C:\MySound.wav")
(So if you don't have VS2005 I'm sorry to waste your time)
|
|
|
|
|
does anybody know how to copy and paste text boxes when not in screen as it only copies the text boxes that are in screen
|
|
|
|
|
Don't tell me you're actually going ahead with 300+ TextBox's on a form? Bad, really bad, idea.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
how about Ctrl+A
And yes, it is indeed bad idea.
Shreekar
|
|
|
|
|
Hi
Is there a way in vb6 to convert a string to an integer. The string I have will always be numbers. I need to do some maths on the string.
|
|
|
|
|
Val[^] is what you're looking for.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thanks. There is also one other thing when I try get the filelen of a file that is about 3gb in size it returns a -value that is no were near the correct size. This is waht I need to do the math on but can't because of the incorrect value given by filelen
|
|
|
|
|
FileLen, since it's return value is a Long (32-bit signed Integer), will only work with files that are less that 2 GB in size. For anything larger, you'll have to call into the Win32 API to get the file size. Discussion[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thanks a million. This worked perfectly.
|
|
|
|
|
CInt or CLng will also work.
Marc Soleda.
... she said you are the perfect stranger she said baby let's keep it like this... Dire Straits
|
|
|
|
|
Hi
I have a VB.NET pgm which is reading 1,2,3... xml-files. For each xml-file, i wish to start another VB.NET pgm, WITH some information from newly read xml-file.
How will i do this ??
Kind Regards
Heino
|
|
|
|
|
That depends on how much information and what type you want to send. If its a small amount, then you could send it as a command line argument. If it's more, then you can either use a seperate file or an advanced technique like .NET Remoting.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
It is just 2 fields, date and time. I never used a command line. Do you have any example ?
By the way, they are in string format.
Heino
|
|
|
|
|
Remember that at the end of the day your VB.Net program is a exe file. So you can pass arguments to it like other exe file.
You can search on Google for handling command line arguments. About the data type of the arguments, it is a good idea to always consider them as strings and typecast them in the receiving code.
Shreekar
|
|
|
|
|
You can find information on getting your applications command line arguments here[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
hi,
i m developing application in vb.net(winforms) & mysql
i have created connection object on form....but as connection is common to all forms so instead of taking it on every form i wnt to write connect function in my module.
will u pliz tell me how to write function for connection..
or wht more i can keep in module in any application of database connectivity.
---Priiya
priya
|
|
|
|
|
(Please try to write proper english. It's tiresome to have to read messages littered with SMS abbreviations and without anything that tells you where one sentence ends and the next begins.)
To create a connection in code, you just create an instance of the connection class for the specific database driver you are using. For an OleDb driver it will be:
Dim connection As OleDbConnection
connection = New OleDbConnection(connectionString)
Substitute connectionString with the actual connection string that you are using.
To make this code available from anywhere, put it in a static (shared in VB) method in some class:
Public Shared Function Connect() As OleDbConnection
Dim connection As OleDbConnection
connection = New OleDbConnection(connectionString)
Return connection
End Sub
---
Year happy = new Year(2007);
|
|
|
|
|
Some columns on the grid need to be centred. I have set the columns to centred and this works OK, except that on the column where the cell is repainted a different colour based on the cell value, the centering is lost.
I have set up some cell formats to change the cell alignment within the CellPainting event:-
formatCell.Alignment = StringAlignment.Center
formatCell.LineAlignment = StringAlignment.Center
formatCell.FormatFlags = StringFormatFlags.NoClip
Using the code below I get the value in the extreme top left of the cell instead of the centre.
If nsCellValue = 0 Then
'This is a full outage and is shown Red
' Erase the cell.
e.Graphics.FillRectangle(redBackBrush, e.CellBounds)
' Draw the grid lines (only the right and bottom lines;
' DataGridView takes care of the others).
e.Graphics.DrawLine(gridLinePen, e.CellBounds.Left, _
e.CellBounds.Bottom - 1, e.CellBounds.Right - 1, _
e.CellBounds.Bottom - 1)
e.Graphics.DrawLine(gridLinePen, e.CellBounds.Right - 1, _
e.CellBounds.Top, e.CellBounds.Right - 1, _
e.CellBounds.Bottom)
' Draw the text content of the cell
If Not (e.Value Is Nothing) Then
e.Graphics.DrawString(CStr(nsCellValue), e.CellStyle.Font, _
Brushes.Black, e.CellBounds.X + 2, e.CellBounds.Y + 2, _
formatCell)
End If
e.Handled = True
etc...
The formatCell in the Drawstring property just does not seem to work. Any ideas on what I am doing wrong would be appreciated.
-- modified at 7:40 Tuesday 16th January, 2007
David Loring
!! Keep Music Live !!
-- modified at 7:40 Tuesday 16th January, 2007
|
|
|
|
|
Yeah, I've gotten some goofy results out of DrawString too. This is what I eventually found that worked for me.
Dim sf As New StringFormat()
sf.FormatFlags = StringFormatFlags.NoWrap Or StringFormatFlags.FitBlackBox
sf.LineAlignment = StringAlignment.Center
sf.Alignment = StringAlignment.Center
sf.Trimming = StringTrimming.None
Dim g As Graphics = e.Graphics
g.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAliasGridFit
g.DrawString( text, font, brush, cellwidth / 2, cellHeight / 2, sf)
g.Dispose()
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thanks very much Dave. I'll give that a whirl!
David Loring
!! Keep Music Live !!
|
|
|
|
|
how do i use combobox in a grid it may be msflex grid of vsflexgrid
akshat
|
|
|
|
|
hi all .net programmers. I need logic.
I can download one file at a time
sending command PASV and RETR
but it downloads only one file at a time
if file is retriving.. I can send more command except ABOR (server don't response)
is there any way to download multiplefile in same time.. (JUST like in Cute FTP Professional 6.0)
|
|
|
|
|
You can do multithreading. You can retrieve different files on different threads. However, you need to design your application to support multithreading - think of thread locking issues, UI update issues, how to share data between threads etc. - MSDN would be a good place to start.
In short, multi threading is the answer to your question.
Shreekar
|
|
|
|