|
K, cheers.
Sorry, should have also asked, how do you add a sound file to the resources, i cannot find its file type, do you use stream or something like that???).
Sory, bit slow at this VB stuff!
|
|
|
|
|
project properties
resources
add existing file
to play My.Computer.Audio.Play(My.Resources.xxxxxxxx, AudioPlayMode.Background)
note; it appears that it will only play pcm wave files. might need to use api call unless yours is pcm...
|
|
|
|
|
Yeah its a PCM file, recorded it in Windows Sound Recorder, i inputted it into vb.net, it shows up on the list, but not on the input list (see screenie), any ideas?
See geocities.com/webharv/error.JPG
|
|
|
|
|
if it's in the resource list then I don't know. As a work a around, add it to the project (not the resource area) and use the physical path to play the sound...
|
|
|
|
|
how to attach macromedia falsh file with vb.net project?
|
|
|
|
|
You need to add a Shockwave flash object from: Window -> Choose toolbox items, in the COM componentes tab check the Shockwave flash object
Alexei Rodriguez
|
|
|
|
|
ya i hav added shockwave objects then
Place the Flash MX file in bin folder of the project.
double click on the form and write code on form load event
Button1.Text = "Play"
double click on the button and wrilte the following code on the Button1_Click event
AxShockwaveFlash1.Stop()
AxShockwaveFlash1.Movie = Application.StartupPath & "\segment1.swf"
AxShockwaveFlash1.Play()
this code is not working.
|
|
|
|
|
Hi, all.
I have a problem reading csv files with quotes embedded in a field, below is a sample of the data I'm trying to read, I have no control over the formatting of this file.
"A",32140,"Router Cutters & Accessories"
"A",32141,"Hinge Hole Cutters & End Mills"
"A",32148,"Step Drills"
"A",32149,"Subland Drills"
"A",32150,"Long Drills"
"A",32151,"Drill Blanks"
"A",32152,"Stub Drills"
"A",32153,"Extra Length Drills"
"A",32154,"Taper Pin Drills"
"A",32155,"Blacksmiths or 1/2" Shank Drills" 'this line is the problem
"A",32156,"Centre Drills"
"A",32157,"Socket Drills"
"A",32158,"Heavy Duty Drills"
"A",32159,"Micro Drills"
"A",32160,"MT Shank Drill"
"A",32161,"MT Shank Extra Length"
"A",32162,"MT Shank Heavy Duty"
"A",32163,"MT Shank Long Drill"
"A",32164,"1/4" Shank Drills" 'so is this one
"A",32165,"Spotting Drill"
"A",32166,"Short Carbide Tipped Drill"
"A",32167,"MT Shank Carbide Tipped Drill"
the code is:
Dim _TCode as string, _ItemCode as long, _Description as string
FileOpen(filenumber, _Path & File.FileName, OpenMode.Input)
While Not EOF(filenumber)
Input(FileNumber, _TCode)
Input(FileNumber, _ItemCode)
Input(FileNumber, _Description)
wend
=error "read past eof"
is there anybody who can help me to read these two lines without error.
Many thank in anticipation.
|
|
|
|
|
Dim sLine,sa(),sCode,sItemCode,sDescription
Open "TESTFILE" For Input As #1
Line Input #1, sLine ' Read line into variable.
Do While Not EOF(1)
sa = split(sLine,",")
sCode = Replace(sa(0),"""","")
sItemCode = Replace(sa(1),"""","")
sDescription = Replace(sa(2),"""","")
Call ProcessRow(sCode,sItemCode,sDescription)
Line Input #1, sLine ' Read line into variable.
Loop
Close #1
|
|
|
|
|
Thanks for your reply,
I thought of using the split function to split the line at commas, but I also thought that whould be a problem with embedded commas.
If thats the case I'm replacing one problem with another.
Regards Alan
|
|
|
|
|
alanhauxwell wrote: I thought of using the split function to split the line at commas, but I also thought that whould be a problem with embedded commas.
If thats the case I'm replacing one problem with another.
You will probably need to parse the string that you read in...
a , followed by " is end of field
end of line is end of field
or some such thing...
Hopefully, you will never get a comma and a double-quote adjacent to each other in your data
Hope this helps
|
|
|
|
|
Hello!
In Windows task manager there are "USER NAME", "CPU" and "MEM USAGE". I would like to know how I can reach these values in vb.net. I am currently able to list all the running processes but no clue how to display the others. I have tried but couldn't get others working Thanks for your help!
Here is my simple code in vb.net /2005
<br />
Private Sub LoadProcessModules()<br />
<br />
Dim myProcesses() As Process<br />
Dim myProcess As Process<br />
Dim I As Int32 = 1<br />
<br />
myProcesses = Process.GetProcesses()<br />
<br />
' Iterate through the process array.<br />
For Each myProcess In myProcesses<br />
I = ListView1.Items.Count<br />
ListView1.Items.Add(myProcess.ProcessName)<br />
ListView1.Items(I).SubItems.Add(myProcess.Responding)<br />
Next<br />
<br />
End Sub<br />
What a curious mind needs to discover knowledge is noting else than a pin-hole.
|
|
|
|
|
You can use the PerformanceCounter class - there's a bit of an example here...[^]
|
|
|
|
|
All of that information is in the Process class for each process you get from GetProcesses. The problem is you're using generic names for things that are a bit more complicated than what you think. For example, CPU usage is TotalProcessorTime, which is a combination of PrivilegedProcessorTime and UserProcessorTime.
Memory usage gets quite a bit more complicated. The values that have to do with memory are NonpagedSystemMemorySize, PagedMemorySize, PagedSystemMemorySize, PrivateMemorySize, VirtualMemorySize, WorkingSet, ..., among others.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
sir/madam,
i have data in the table and database(MS-Access) .Can i send the data into excel sheet.
please help.
thanks and regards
pankaj garg
|
|
|
|
|
Hi All
This is Sagar here. I have a problem. Can anyone help me out of this? I want to transfer the text written in a text box in a windows form to a crystalreport viewer in the button click event. I will be very grateful is somebody help me out of this.
Regards
Sagar Pattnayak
Sun-Dew Solutions
9831169962
|
|
|
|
|
Dim mNoOfObjects As Byte = 1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim lbl As New Label()
Dim txt As New TextBox()
If mNoOfObjects < 20 Then
mNoOfObjects += 1
txt.Name = "TextBox" & mNoOfObjects
txt.Location = New System.Drawing.Point(TextBox1.Left, TextBox1.Top + (TextBox1.Height * (mNoOfObjects - 1)))
lbl.Name = "Label" & mNoOfObjects
lbl.Location = New System.Drawing.Point(Label1.Left, txt.Top)
lbl.AutoSize = True
lbl.Text = "Item Name - " & mNoOfObjects
Controls.AddRange(New System.Windows.Forms.Control() {lbl})
Controls.AddRange(New System.Windows.Forms.Control() {txt})
Else
MessageBox.Show("Cannot order more then 20 items in a bill", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information)
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim Ctr As Byte
For Ctr = 1 To mNoOfObjects
' ***********************************************************
' How to display text of dynamically created textbox1, textbox2 ...
' ***********************************************************
Next
End Sub
Deepak
|
|
|
|
|
For Ctr = 1 To mNoOfObjects
msgbox(me.controls("TextBox" & Ctr).text)
Next
|
|
|
|
|
Thanks Dear
The statement <<< msgbox(me.controls("TextBox" & Ctr).text) >>> worked absolutely fine.
Deepak
|
|
|
|
|
Hi all,
I am trying to call a pl/sql procedure which is defined inside a package thru Visual Basic. I am getting an error message saying that
"....
...
Description=ORA-06550:line 11, column 1:PLS-00201:identifier 'LOCALBOARDING.UPDATEMOVEMENTDETAILS' must be declared ORA-06550:line11, column 1: PL/SQL statement ignored."
Here LOCALBOARDING is the package name and UpdateMovementDetails is the procedure name.
I am using ExecSQL method in VB. ie inside BEGIN and END block, I am trying to call the packagename.procedure with parameters.
If I copy the code in the backend means, its executing properly. But no thru VB. Kindly help.
Thanks in advance.
Surendran
|
|
|
|
|
Hello frends,
I have to prepare salary slip so want salary slip format.
Please Anyone give me Salary slip sample.
Thanks for any help in advance.
-Regards Priya.
"The Difficult i can do it now...
The Impossible will take a little longer."
|
|
|
|
|
Hi,
I think, Getting a salary slip from a person is not that much easy. Instead, you can search the net for sample salary slip formats.
Surendran
|
|
|
|
|
plz give me the answer
how to convert a digital value to words(thats in indian formate) in crystal report.
exm:
if the digit is 10 then we get "ten"
if the digit is 100000 then we get "one lakh"
hari
|
|
|
|
|
Dim currStr As String, finalStr As String, paramStr As String
Dim counter As Integer, strR As String, strL As String, cutFrom As Integer
Dim lvl As Integer, paiseStr As String
Public Function funGetNumberInWords(ByVal paramNum As String) As String
Dim paramStr As String
Dim cutFrom As Integer
Dim finalStr As String
Dim currStr, strR, strL As String
Dim counter, lvl As Integer
paramStr = paramNum
cutFrom = Len(paramStr): finalStr = "": currStr = "": strR = "": strL = "": counter = 1: lvl = 1
Do While counter <= Len(paramStr) 'Starts from Last Digit
currStr = "": strR = "": strL = ""
If lvl = 2 Then 'For Hundreds Place
strL = Mid(paramStr, cutFrom, 1)
strR = ""
counter = counter + 1
cutFrom = cutFrom - 1
Else
strR = Mid(paramStr, cutFrom, 1)
If cutFrom - 1 > 0 Then
strL = Mid(paramStr, cutFrom - 1, 1)
End If
counter = counter + 2
cutFrom = cutFrom - 2
End If
currStr = NumToWords(lvl, strL, strR) 'Conv Function
finalStr = currStr + finalStr
lvl = lvl + 1
Loop
funGetNumberInWords = RTrim(finalStr)
Label1.Caption = finalStr
End Function
Private Function NumToWords(ByVal lvl As Integer, ByVal str1 As String, ByVal str2 As String, Optional ByVal isAfterDec As Boolean = False) As String
NumToWords = ""
If lvl = 2 Then
NumToWords = NumName(str1, "Units")
Else
If str2 <> "" Then
Select Case str1
Case "0", "": NumToWords = NumName(str2, "Units")
Case "1": NumToWords = NumName(str2, "Teens")
Case Else: NumToWords = IIf(str2 = "0", NumName(str1, "Tys"), NumName(str1, "Tys") & NumName(str2, "Units"))
End Select
Else
NumToWords = NumName(str1, "Units")
End If
End If
If isAfterDec Then
NumToWords = Trim(NumToWords)
Else
NumToWords = ValueName(NumToWords, lvl)
End If
End Function
Private Function NumName(ByVal s As String, ByVal lvl As String) As String
If Len(s) = 0 Or Len(lvl) = 0 Then Exit Function
If lvl = "Units" Then
Select Case s
Case "0": NumName = "Zero"
Case "1": NumName = "One"
Case "2": NumName = "Two"
Case "3": NumName = "Three"
Case "4": NumName = "Four"
Case "5": NumName = "Five"
Case "6": NumName = "Six"
Case "7": NumName = "Seven"
Case "8": NumName = "Eight"
Case "9": NumName = "Nine"
End Select
End If
If lvl = "Teens" Then
Select Case s
Case "0": NumName = "Ten"
Case "1": NumName = "Eleven"
Case "2": NumName = "Twelve"
Case "3": NumName = "Thirteen"
Case "4": NumName = "Forteen"
Case "5": NumName = "Fifteen"
Case "6": NumName = "Sixteen"
Case "7": NumName = "Seventeen"
Case "8": NumName = "Eighteen"
Case "9": NumName = "Nineteen"
End Select
End If
If lvl = "Tys" Then
Select Case s
Case "2": NumName = "Twenty "
Case "3": NumName = "Thirty "
Case "4": NumName = "Forty "
Case "5": NumName = "Fifty "
Case "6": NumName = "Sixty "
Case "7": NumName = "Seventy "
Case "8": NumName = "Eighty "
Case "9": NumName = "Ninety "
End Select
End If
End Function
Private Function ValueName(ByVal inVal As String, ByVal lvl As Integer) As String
If inVal <> "" And inVal <> "Zero" Then
Select Case lvl
Case 1: ValueName = inVal
Case 2: ValueName = inVal & " Hundred "
Case 3: ValueName = inVal & " Thousand "
Case 4: ValueName = inVal & " Lakh "
Case 5: ValueName = inVal & " Crore "
End Select
End If
End Function
there r three functions and some dicleration just copy and paste in ur form
and gust pass ur number in the funGetNumberInWords function u will find ur answer B Jp
|
|
|
|
|
when I'm in a textbox(big and multilined), and press Ctrl+T a textbox2(small box)must move beside the cursor(I mean the caret).
I used this
Dim caretPosition As Point = TextBox1.GetPositionFromCharIndex(TextBox1.SelectionStart)
but,
(it says "GetPositionFromCharIndex" is not a member of System.Windows.Forms.TextBox")
(I quess it's becuase I use vb .net(2003) version)
pls Help very urgent(this the third time I'm posting this).
|
|
|
|
|