|
i want to add sound file to my application and work in form load how?!
ma_refay
|
|
|
|
|
Put it in resource somekinda res type "Wav" File and extract it when form is loading
Dim S as string
S=strconv(LoadResData(ResouceID,ResourceType In Here EG:"Wav"),vbUnicode)
Get the function SndPlaySound From api viewer.
and At the form_Load
sndplaysound(s,SND_ASYNC or snd_memory);
like that.simple
Kanchana
-- modified at 18:22 Thursday 8th June, 2006
|
|
|
|
|
hi i want to use currencymanger in my project so when i add new product to my dataset and before i update the dataset to databse i can move between theses products i add there for buuton in the form to move first ,last ,next ,previous so when i add new projeect the label that dir what record i have now and all record like this '5 of 17'
the error is when i try to add new product he add it but he edit in the first product in dataset because i don't know to told code to add new item to currency manger when i add new product and set focus on the new poistion
the code i use
" dim cr as currencymanger"
"cr=me.bindingcontext(datasetname,tablename)"
if i try to use the statement "cr.addnew" i have error because i use sqldataadapter to add new rows and add these rows to dataset hthe .net told me that some parameters can't alloe null inc ase of using "cr.addnew"
thanks and sorry for long
ma_refay
|
|
|
|
|
Anyone got a simple way to get the duration(minutes and seconds) of a .MP3 file?
I notice in windows if you open a folder with .MP3 files in it and hit - VIEW - DETAILS, you will see the duration. Anyone know how to pull that into you program much like:
Dim fileData As FileInfo = My.Computer.FileSystem.GetFileInfo(OpenFileDialog1.FileName)
Will give you just the FILENAME
- Coding is fun - plus Skittles and DEW!
DaleG
|
|
|
|
|
Needs:
=========
1 Form
Private Declare Function mciSendString Lib "winmm" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, _
ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Private Sub Form_Load()
Dim Befehl As String
Dim Datei As String
Dim Laenge As Long
Dim Ret As String * 256
Datei = "D:\ZAPP3.MP3"
Befehl = "Open " & Datei & " alias MediaFile"
mciSendString Befehl, vbNullString, 0, 0&
Befehl = "Set MediaFile time format milliseconds"
mciSendString Befehl, vbNullString, 0, 0&
Befehl = "Status MediaFile length"
mciSendString Befehl, Ret, Len(Ret), 0&
Laenge = CLng(Ret)
Befehl = "Close MediaFile"
mciSendString Befehl, vbNullString, 0, 0&
MsgBox Laenge / 1000 & " Sec"
End Sub
|
|
|
|
|
Sir,
I have a program containing more then 35 textboxes and have 2 pages .Can you please send me code for checking the preview of the page and finally printing the page.
Thanks and regards
Amaneet Brar
|
|
|
|
|
Hi,
I am using dtpicker control in my VB application. I don't need to show the full date on calendar view. Is it possible to hide that.
Any luck.
Regards
Rams.
Be simple and Be sample.
|
|
|
|
|
I am using a datagrid on my Windows form to display records stored in a SQL Server database. When the form loads the datagrid is populated with the records. When I select an item in the datagrid the values are displayed in some text boxes. So when i select a different row in the datagrid the text boxes change accordingly. This part is fine.
I then have two buttons, Add and Delete. I use SQL statements to Add and Delete records. The SQL statements are fine and when I check the table in SQL Server the Addition or Deletion has been successful. The problem is refreshing my datagrid. If i close the form and open it again the datagrid reflects the changes, but i want it to refresh without closing and opening the form. The code for the Add button is as follows:
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
Dim Command As SqlCommand
Command = New SqlCommand("Insert into FitmentReasons(code,description, active) values ('" & txtCode.Text & "','" & txtDescription.Text & "','1')", gConn)
Command.ExecuteNonQuery()
txtCode.Clear()
txtDescription.Clear()
End Sub
|
|
|
|
|
after adding new record again bind the data to datagrid using select query.
|
|
|
|
|
You need to fill the dataset or datatable again and set the datasource to the datagrid.
|
|
|
|
|
Hai,
I am using grid with 1000 cols and 20 rows. In each column for some cells font is different than default fpnt. But this is giving out of memory error. What is the soulutions.
With regards
|
|
|
|
|
There is a maximum number of cells a MSFlexgrid can display. I cant remember the exact number and google isnt helping at the moment. From what i remember (from the problems we had) 1000 x 20 (and maybe a couple of fixed rows/columns) is probably pretty close to that limit. Try using the MSHFlexgrid instead.
Jon
|
|
|
|
|
hi, can anyone tell me about free ebooks for vb.net.
Himanshu Arora
VSNL
New Delhi
|
|
|
|
|
|
hello every body. I want to convert string to unicode and unicode to string. can you tell me.
|
|
|
|
|
String is first converted into ASCII and then to Unicode by character mapping and visa-versa!
I did the same thing while handling Hindi-fontcode. Hindi-font-Text was first converted into ISCII and then to Unicode & visa-versa. For that I used dlls...
All this thing is based on character mapping...
Padma Gahlot
|
|
|
|
|
|
Hi,
I am writing an addin tat adds a couple of menu items to various CommandBars in Visual Studio 2005. I have all the menu items working fine but I still have a few other things to get sorted out.
I am adding some menu items to the context menu of the Project Folder. I want them all to appear after the Build, Rebuild and Clean menu items. How can I add a seperator before my first menu item and after my last menu item?
I have added a few menu items to the context menu of the code window. How can I fix it so that these menu items are only displayed when the active document is either a .cs or .vb file?
How can I get rid of the icons that are added automatically to my menu items?
Thanks very much,
dlarkin77
|
|
|
|
|
I have a field in MSSQL server of date type which is nullable. I am checking the field from a RecordSet field but I am having the operation not allowed error
If rs.Fields("rdate").Value Is DBNull.Value Then
// Disableing the DateTimePicker
DateTimePicker1.Enable = False
else
//display the value in the DTP control
DateTimePicker1.Value = rs.Fields("rdate").Value
End If
Are their any other way to check null value of date type
Plz help me.
|
|
|
|
|
Is this VB6? rs.fields makes me think its VB6. DBNull.Value is a vb.net type and not available in VB6.
for VB6 try
if IsNull(rs.fields("rdate")) then
Jonathan
|
|
|
|
|
Hi Jonathan,
No, it is VB.Net. I tried the following
If rs.Fields("rdate").Value Is DBNull.Value Then
and
If IsDBNull(rs.Fields("rdate").Value) = True Then
But always get the error that the operation is not allowed for Date Type with DBNull type.How can I handle it even tried the
Public Function dNull(ByVal O As Object ) As Boolean
If IsDBNull(O) = True Then
Return True
Else
Return False
End If
End Function
but still getting the same error.So how to handle Null value in VB.Net for Date Type.
|
|
|
|
|
What technology are you using for the data access?
It doesnt sound like ADO.NET as there is no fields collection in any of the ADO.NET objects. Thats why i thought you were using VB6 because it looks like you are using classic ADO.
If this is the case then i would guess thats your problem.
If you havent imported the System namespace you could try that first as DBNull is actually System.DBNull but the 'Is DBNull.Value' syntax is correct. If that doesnt work then i would guess its because classic ADO does not expose a datatype of System.DBNull so i cant really see any way around it other than dropping the ADO recordsets and using ADO.NET's Datasets and Datatables.
Jon
|
|
|
|
|
Thanks Jonathon,
I used the ADO.Net Dataset and now the same code is working. Thanks for your replies.
Ronny
|
|
|
|
|
The above error is being displayed when trying to create a setup wizard for a .NET application.
Any ideas?
Jon
|
|
|
|
|
How to use control WebBorser in VB.NET 2005
................
|
|
|
|