|
Add a label to your form. Then do this
label.Text = File.ReadAllText(path)
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I can see nothing wrong with your code but then again I am a C# developer not a VBer (anymore). However the one thing I will point out is to dispose of your streams. In C# there's a nice using statement but in VB I presume you'll have to do something like the following:
Dim sr As StreamReader = File.OpenText(path)
Do While sr.Peek() <> -1
Console.WriteLine(sr.ReadLine())
Loop
sr.Close()
sr.Dispose()
I doubt it. If it isn't intuitive then we need to fix it. - Chris Maunder
|
|
|
|
|
hi
is their is away to check the first three letter from string
|
|
|
|
|
Hello,
You can use the Substring() method to implement the same.
For example:
<br />
<br />
Dim str As String = "Test String"<br />
MsgBox("First Three letters: " & str.Substring(0, 3))<br />
<br />
I hope this will help.
Regards,
Allen
Allen Smith
Software Engineer
ComponentOne LLC
www.componentone.com
|
|
|
|
|
|
Hello, I have 2 Excelbooks, ver8 and ver9. And I must have a value whith me in to ver8 created in ver9. But I failed in all my tryings...
I start the Excelbook ver9 and whithin the macro in ver9 I started Excelbook ver8. I want to passed an If-statement whith help of this public variable (NyVerNr) from ver9 but I cant transfer the value in the public variable "NyVerNr" - howe do I do this ?
I try this code:
Public OldVerNr As Integer
Public NyVerNr As Integer
---------------------------------------------------------------
Private Sub FetchFlexTime_Click()
Dim OldVer As String
Dim NyVerNrText As String
Dim NyYearNr
Application.ScreenUpdating = False
OldVer = "F:\Documents\Flextid8.xls"
NyVerNrText = Worksheets("Grunduppgifter").Cells(6, 2)
NyVerNr = Right(NyVerNrText, 2)
' this is all right - now I have a value in NyVerNr !
Workbooks.Open Filename:=OldVer
"and now is ver8 open - and here is the macro in ver8"
Private Sub Workbook_Open()
Dim NyVerNr As Integer
Dim OldVerNr As Integer
Dim VerNr As Integer
'fetch the earlier NyVerNr and calculate the difference. The OldVerNr is 8 the NyVerNr should be 9
OldVerNrText = Worksheets("Grunduppgifter").Cells(6, 2)
OldVerNr = Right(OldVerNrText, 2)
VerNr = NyVerNr - OldVerNr
' but when I come to this part I have lost the value in NyVerNr, fetch from ver9
' the result for VerNr should be 1 - whitch means that I will passed this If-statement !
If VerNr <= 0 Then
please help me to get right !
/keda
modified on Tuesday, May 13, 2008 11:17 AM
|
|
|
|
|
Hai all,
i am totally new for xml files in .net.
i have one xml file like
<Gateway>
<Name>ONE</Name>
<UserID>inone</UserID>
<PWD>one</PWD>
<URL>http://ap.abc.com/http/sen.asp?user={0}&password={1}&track=1</URL>
<Weight>100</Weight>
</Gateway>
<Gateway>
<Name>Two</Name>
<UserID>intwo</UserID>
<PWD>two</PWD>
<URL>http://ap.abc.com/http/sen.asp?user={0}&amp;password={1}&amp;track=1</URL>
<Weight>90</Weight>
</Gateway>
now i had to get the url by using the category(Name ONE,TWO)in xml file.....
in a function
public function geturl(by val category as string)string
dim strurl as string=""
*********** I need some guidance to...how to get the url which is in xml in vb.net?
return strurl
End function
Thanks
Subbu.
|
|
|
|
|
Load the XML into the XmlDocument class. This impliments the standard W3C DOM for accessing XML. Then you can do something like
doc.SelectNodes("/Gateway/URL")
to get a collection of the URL nodes, which you can then iterate over and examine. The language used to selecte nodes is called XPath.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Communication between multiple instances of a program with Shared members and events.
This works fine as long the instances are started by the same thread.
If I start multiple instances by clicking the exe file it doesn’t work.
What to do?
|
|
|
|
|
You need to create cross process communication, probably using WCF.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks mr Graus,
I have to stay with .NET 2.0 and for WCF it seems that 3.0 is needed
What other options are there?
Regards from Sweden
|
|
|
|
|
Hi all,
i want to convert RTF to PDF programmatically.
i had tried itextsharp also , but i am not able to figure out what to do
is there any one experience in this area
thanks in advance
|
|
|
|
|
If you're planning on writing your own component then you'd probably need to look at the RTF Specification, figure out how to read it and then map these different things onto the iTextSharp interface. It's a fairly obtuse interface I know (I've worked with it) but the biggest issue I see here is parsing the RTF.
I doubt it. If it isn't intuitive then we need to fix it. - Chris Maunder
|
|
|
|
|
Hi,
Please I need to put the row number at RowHead of each row i am using VB.Net 2003
Mohammad Al Hoss
|
|
|
|
|
hi,
i m assuming you are asking about datagridview. In vb.net 2005 following statement works
Dim Str As String = "YourValue"<br />
DataGridView1.Rows(DataGridView1.Rows.Count - 2).HeaderCell.Value = Str
hope this also works in vb.net 2003
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
Sory this does not work in vb.net 2003 but thanks alot for the help
Mohammad Al Hoss
|
|
|
|
|
hi all
I have one problem.I have one table in access which contains one field named as Visible,datafield as "yes/No".In evry table i have this field.
One starnge thing is : I connect my database to report,All reports which are having "VISIBLE" field.When i run my crystal report,i got answer of that field as "Y" or "N" in some of the reports.And answer of another reports as "TRUE" or "Flase"
How could be possible?
Thanks
monika
|
|
|
|
|
monika_vasvani wrote: Subject:VB.NET
How is that helpful ?
monika_vasvani wrote: How could be possible?
I guess sometimes it's being shown as a different datatype, one to which is can be converted ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
It's probably the formatting property in your crystal report. Since the variable is Boolean, the formatting in the report will determine "Yes" or "Y".
|
|
|
|
|
All I want to do is create a VBA script in Excel 2003 where I search through a spreadsheet, and delete every row where column E in the row (a date and time field) does not contain the text 2008.
So e.g.
If E1 contains 2008 delete row 1
If E2 does not contain 2008 keep this row (row 2)
If E3 contains 2008 delete row 3
Continue until no more values
How would I do this please?
I have tried to do it using in built features on Excel but i can only find and replace...etc and the macro recording isnt really helping much hense why i am asking for your help.
Thanks
modified on Tuesday, May 13, 2008 5:23 AM
|
|
|
|
|
harveyhanson wrote: All I want to do is create a VBA script in Excel 2003 where I search through a spreadsheet, and delete every row where column E in the row (a date and time field) does not contain the text 2008.
So e.g.
If E1 contains 2008 delete row 1
If E2 does not contain 2008 keep this row (row 2)
If E3 contains 2008 delete row 3
Continue until no more values
The Rows collection of the worksheet has a Delete function which you can use to delete an entire row.
For example: ActiveSheet.Rows(1).Delete will delete row 1.
HTH
|
|
|
|
|
Hi
I want to know ..How to validate an event handler whether it is triggered at the
time of form load or not ..
Please help me with any example code.
Thanks
Chaitanya
|
|
|
|
|
You can't validate it, because it never fails to fire. You can handle it and check there, if you want, but if it,s for example, the form load event, it will fire.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
i have managed to create a program which connects to a cam and also copies a frame to another picture box. the problem now is how to compare the two picturebox QUICKLY...... in my code i had included a formula that was used in vb6. but now cannot be used cause of the picturebox.poin(x,y) was removed in vb.net which makes it harder to convert...
this was in vb 6.0
Private Function Different(ByVal a As Long, ByVal b As Long) As Boolean<br />
'Checks different of two colors<br />
ar = a Mod 256: a = a \ 256<br />
ag = a Mod 256: a = a \ 256<br />
ab = a Mod 256: a = a \ 256<br />
<br />
br = b Mod 256: b = b \ 256<br />
bg = b Mod 256: b = b \ 256<br />
bb = b Mod 256: b = b \ 256<br />
sense = 255 - Text1.Text * 5<br />
<br />
Different = (Sqr((ar - br) * (ar - br) + (ag - bg) * (ag - bg) + (ab - bb) * (ab - bb)) > sense) 'formula for counting different<br />
End Function<br />
<br />
Private Sub Timer1_Timer()<br />
'getting picture from camera<br />
SendMessage mCapHwnd, GET_FRAME, 0, 0<br />
SendMessage mCapHwnd, COPY, 0, 0<br />
Picture1.Picture = Clipboard.GetData: Clipboard.Clear<br />
<br />
<br />
stepp = 3 'Grid dense<br />
<br />
Dim qan, qann As Long<br />
qan = 0<br />
qann = 0<br />
<br />
For i = 1 To Picture1.Width / Screen.TwipsPerPixelX Step stepp<br />
For j = 1 To Picture1.Height / Screen.TwipsPerPixelY Step stepp<br />
<br />
If Different(Picture1.Point(i * stepp * Screen.TwipsPerPixelX, j * stepp * Screen.TwipsPerPixelY), Picture2.Point(Screen.TwipsPerPixelX * i * stepp, j * stepp * Screen.TwipsPerPixelY)) Then<br />
Picture1.Circle (i * stepp * Screen.TwipsPerPixelX, Screen.TwipsPerPixelY * j * stepp), 1, RGB(255, 0, 0)<br />
qann = qann + 1<br />
End If<br />
<br />
Next<br />
Next<br />
Label1.Caption = Int(qann * 100 / 910) & "%" 'Counting motion in percents<br />
ProgressBar1.Value = Int(qann * 100 / 910)<br />
End Sub<br />
<br /> i need to convert this in vb.net
here is the link of my vb.net code
http://rapidshare.com/files/114521447/EyetxtV1.rar.html[^]
please anyone please help me
|
|
|
|
|
First of all, ditch the picture box. Second, draw your own frames in your paint event. Third, if you want to compare two images, read my image processing articles. VB sucks, you'll probably need a C# dll to do it. It would make more sense to compare them using C++ inside your DirectX stream.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|