openfile dialog box in VB.Net
-
okay i recently made a VB program to allow a user to select a file and open it.. but the thing is..the openfile dialog box opens, it lets user chose a file to open..then wen u click open, nuthin opens! no error message comes but nothing gets opened...do i hav to maybe provide a data grid on the form to open the file? why cant it just open the file in its default environment? say u want to open a .txt file..why wont it open the .txt file in notepad? or do i NEED to provide a data grid on the form? does anyone know how it works? do i need to bind the file to a datagrid?!...Any comments are welcome!!! :) rubdub :)
-
okay i recently made a VB program to allow a user to select a file and open it.. but the thing is..the openfile dialog box opens, it lets user chose a file to open..then wen u click open, nuthin opens! no error message comes but nothing gets opened...do i hav to maybe provide a data grid on the form to open the file? why cant it just open the file in its default environment? say u want to open a .txt file..why wont it open the .txt file in notepad? or do i NEED to provide a data grid on the form? does anyone know how it works? do i need to bind the file to a datagrid?!...Any comments are welcome!!! :) rubdub :)
The OpenFiledDialog only tracks which file the user PICKED to open. It will not open the file for you. You have to supply the code to open the file in the way you want. Datagrid's won't help you at all... RageInTheMachine9532
-
okay i recently made a VB program to allow a user to select a file and open it.. but the thing is..the openfile dialog box opens, it lets user chose a file to open..then wen u click open, nuthin opens! no error message comes but nothing gets opened...do i hav to maybe provide a data grid on the form to open the file? why cant it just open the file in its default environment? say u want to open a .txt file..why wont it open the .txt file in notepad? or do i NEED to provide a data grid on the form? does anyone know how it works? do i need to bind the file to a datagrid?!...Any comments are welcome!!! :) rubdub :)
Look at the "FileName" property of the "OpenFile" dialog. It will be set to the file path of the choosen file. The "Cancel" button will return a null string in "FileName". If "to err is human", programmers must be superhuman...