text files
-
display txt in a picture box? or another way OpenFileDialog1.Filter = "Textfiles (*.txt)|*.txt" If(OpenFileDialog1.ShowDialog()) = DialogResults.OK Then //i'm a attepting this wrong? Or can i use pictureBox?
-
display txt in a picture box? or another way OpenFileDialog1.Filter = "Textfiles (*.txt)|*.txt" If(OpenFileDialog1.ShowDialog()) = DialogResults.OK Then //i'm a attepting this wrong? Or can i use pictureBox?
i'm not sure exactly what you want to do... do you want to display a list of text files from a particular directory to the user? the optimal way to do this is think would be to use a list box and just query directly into the filesystem for a list of files (with a filter for text files). Then add the results into your listbox. am i mis-understanding you?
-jim
-
i'm not sure exactly what you want to do... do you want to display a list of text files from a particular directory to the user? the optimal way to do this is think would be to use a list box and just query directly into the filesystem for a list of files (with a filter for text files). Then add the results into your listbox. am i mis-understanding you?
-jim
hey jim, yes it was unclear what i was trying to say before...it is very simple def. for one who has been doing VB for a long time. I just want to view a Txt File in a picture box. To see what the txt file has written in it.. clearer?? hmmmmm......say if i had gg.txt on my desktop...now in my program i want to view that txt file, and what it says(its value). I Know how to view a imgage ,but not a txt file and a animation file(flash). *also do u know how to Run a flash animation in a VB form?* *i get lost with some programming terms, i am learning stuff on my own soo i am just gaining knowledge.*
-
hey jim, yes it was unclear what i was trying to say before...it is very simple def. for one who has been doing VB for a long time. I just want to view a Txt File in a picture box. To see what the txt file has written in it.. clearer?? hmmmmm......say if i had gg.txt on my desktop...now in my program i want to view that txt file, and what it says(its value). I Know how to view a imgage ,but not a txt file and a animation file(flash). *also do u know how to Run a flash animation in a VB form?* *i get lost with some programming terms, i am learning stuff on my own soo i am just gaining knowledge.*
WartHog000 wrote: clearer?? much, thanks. typically you would use a textbox to display the contents of a text file. you use a filestream to get a handle for the actual file you want to open, then use a streamreader object to extract it's contents. something like below...
Dim fileSelector As FileDialog
If (fileSelector.ShowDialog = DialogResult.OK) Then
Dim strmSelectedFile As New IO.FileStream(fileSelector.FileName, IO.FileMode.Open)
Dim strmReadFile As New IO.StreamReader(strmSelectedFile)
Me.txtFindItem.Text = strmReadFile.ReadToEnd
End Ifof course you can set the filter and initialdirectory properties of the fileDialog in order to determine where to look and what to look for. WartHog000 wrote: also do u know how to Run a flash animation in a VB form? you would need some sort of a flash host control for development. i would think if you have flash installed (a developer version, not the flash player) there would be some sort of .net or com component for hosting flash files, but i'll let someone with more flash experience handle giving you advice on that... hope this helps.
-jim
-
WartHog000 wrote: clearer?? much, thanks. typically you would use a textbox to display the contents of a text file. you use a filestream to get a handle for the actual file you want to open, then use a streamreader object to extract it's contents. something like below...
Dim fileSelector As FileDialog
If (fileSelector.ShowDialog = DialogResult.OK) Then
Dim strmSelectedFile As New IO.FileStream(fileSelector.FileName, IO.FileMode.Open)
Dim strmReadFile As New IO.StreamReader(strmSelectedFile)
Me.txtFindItem.Text = strmReadFile.ReadToEnd
End Ifof course you can set the filter and initialdirectory properties of the fileDialog in order to determine where to look and what to look for. WartHog000 wrote: also do u know how to Run a flash animation in a VB form? you would need some sort of a flash host control for development. i would think if you have flash installed (a developer version, not the flash player) there would be some sort of .net or com component for hosting flash files, but i'll let someone with more flash experience handle giving you advice on that... hope this helps.
-jim
ahh ic....yes that will help alot. thanks a bunch.
-
ahh ic....yes that will help alot. thanks a bunch.
i did the code i got this error that the FileDialog did not work? the error has this: An unhandled exception is fileDialog a openFileDialog???
-
i did the code i got this error that the FileDialog did not work? the error has this: An unhandled exception is fileDialog a openFileDialog???
i figured it out.....thanks for all the help jim
-
hey jim, yes it was unclear what i was trying to say before...it is very simple def. for one who has been doing VB for a long time. I just want to view a Txt File in a picture box. To see what the txt file has written in it.. clearer?? hmmmmm......say if i had gg.txt on my desktop...now in my program i want to view that txt file, and what it says(its value). I Know how to view a imgage ,but not a txt file and a animation file(flash). *also do u know how to Run a flash animation in a VB form?* *i get lost with some programming terms, i am learning stuff on my own soo i am just gaining knowledge.*
Why not read the text file into a string using a StreamReader and display the string in a multiline textbox. If you have knowledge, let others light their candles at it. Margaret Fuller (1810 - 1850)
-
Why not read the text file into a string using a StreamReader and display the string in a multiline textbox. If you have knowledge, let others light their candles at it. Margaret Fuller (1810 - 1850)
i get wat you are saying...multilined textbox?....is that a normal text box? or is it like a textbox that can view paragraphs from a .txt file?