473,395 Members | 1,679 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

FileOpen Diag. @ VB.NET

I am working with the openfile dialogue on VB.NET express. I want the
filename to appear on a label that I have on the main form when I click
on a file on the openfile dialogue. How can this be accomplished?
Example, I have the openfile diag. Displayed & in the background I have
my main form, If I single-click on a file in the openfile diag. I want
that same filename to be displayed on the main form. Thanks in advance
for your help.
*** Sent via Developersdex http://www.developersdex.com ***
Dec 6 '05 #1
9 3056
William Cruz wrote:
I am working with the openfile dialogue on VB.NET express. I want the
filename to appear on a label that I have on the main form when I click
on a file on the openfile dialogue. How can this be accomplished?
Example, I have the openfile diag. Displayed & in the background I have
my main form, If I single-click on a file in the openfile diag. I want
that same filename to be displayed on the main form. Thanks in advance
for your help.
*** Sent via Developersdex http://www.developersdex.com ***


If OpenFileObject.ShowDialog = ShowDialog.Ok then
FileLabel.Text = OpenFileObject.Filename
End if
Dec 7 '05 #2
Ok, this is what I have, but it doesn't work. :(

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

If OPfile.ShowDialog = Windows.Forms.DialogResult.OK Then

FileLabel.Text = OPfile.FileName
End If

End Sub
End Class

*** Sent via Developersdex http://www.developersdex.com ***
Dec 7 '05 #3
"William Cruz" <wc*****@msn.com> schrieb:
Ok, this is what I have, but it doesn't work. :(


The text will updated after closing the dialog.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Dec 7 '05 #4
I was wanting it to update automaticly when I single-click on the file.
Is this possible?

William Cruz

*** Sent via Developersdex http://www.developersdex.com ***
Dec 7 '05 #5
William Cruz wrote:
I was wanting it to update automaticly when I single-click on the file.
Is this possible?

William Cruz

*** Sent via Developersdex http://www.developersdex.com ***


How can they see your textfile when the dialog is shown? It could be
covering it. You'll have to make your own file dialog to get this to
work the way you want though.

Chris
Dec 7 '05 #6
I was planing on show the diag. box in a pre-determined location, not
over the main form. Is there a way to modify the openfilediag. provided
by vb.net?

William Cruz

*** Sent via Developersdex http://www.developersdex.com ***
Dec 7 '05 #7
>I was planing on show the diag. box in a pre-determined location, not
over the main form. Is there a way to modify the openfilediag. provided
by vb.net?

Not impossible, however because you ask this style of question probably not
by you.
The answers given to build your own file dialog will probably than be the
best.

In fact are you building it by wanting the file name to be displayed in
another control in advance that the user has made his decission.

I hope this helps,

Cor

William Cruz

*** Sent via Developersdex http://www.developersdex.com ***

Dec 7 '05 #8
hi William,
it is possible to have the file name on the label as u select them
in "open file " dialog. this can be done through THREADING. create one
thread and using thread display the "open file" dialog. and check in
thread if the file selected or not. if selected then update the lable.
i'm not sure. it is just an idea. but if it works then label will be
update reapidly so ti may flicker. check it out yourself

Dec 7 '05 #9
"Lucky" <tu************@gmail.com> schrieb:
it is possible to have the file name on the label as u select them
in "open file " dialog. this can be done through THREADING. create one
thread and using thread display the "open file" dialog. and check in
thread if the file selected or not. if selected then update the lable.
i'm not sure. it is just an idea. but if it works then label will be
update reapidly so ti may flicker. check it out yourself


I believe it's possible with a Win32 dialog hook, but that's not that
easy...

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Dec 7 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: MR BIGLESWORTH | last post by:
Hi, I have A FileOpen command that opens A file outside of the local folder (where my program is). That works fine, but; I want to create a file in the local folder after that 1st file is opened,...
0
by: Wendy Attenberger | last post by:
We are using the FileOpen method to read through a .css file. It is dropping the period in front of a .css class name. (whenever the line begins with a period...it just drops it.) FYI...It...
2
by: zurg | last post by:
Hi! I have a specific problem - I need to take some informations from a .txt file from another computer... I use OpenFile and the program runs perfectly... But when I run it second time I get an...
1
by: Venkatesh Subbaramu | last post by:
Hi, I found the folowing errors in my diag log ADM5500W DB2 is performing lock escalation. The total number of locks currently held is "1031", and the target number of locks to hold is "515"....
13
by: Praveen_db2 | last post by:
Hi All db2 8.1.3 Windows I am getting this error in db2diag.log.Please tell why is this error (-444) always there and how to go about for removing it. Diag.log output:...
0
by: jharikrishna | last post by:
How to use filestreams in c# How to open the fileopen window how to read the text in that file.
0
by: Subhankar | last post by:
Hi, I am trying to open a MS Project residing in a MS SQL Server. I have the following code for the FileOpen: projectApp.FileOpen("<ChouOister>\\Test Project 2", false, 0, null, null, null,...
1
by: ckb | last post by:
Hi, I need to get the fileopen saveas dialogbox in javascript.I have used the but i want to extract the location ang the file name that the user chooses in my code for further processing once the...
1
by: Dan van Ginhoven | last post by:
Hi! For a couple of nights now I have observed that at 18:00 diag.log is flooded with this message: 2008-11-18-18.13.20.151992+060 E672850E578 LEVEL: Warning PID : 5102 ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.