|
The OP didn't specify WinForms or WebForms. Your answer is WebForms specific as there is a Close event in WinForms.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
hi,
i'm not soo agree with the guy answered before
i just tryed close event for the same target
it works be sure man
try to be good if you can't be the best
|
|
|
|
|
You can add an event handlier for the closing or closed event. If you chose the closing event be aware that the form might not get closed as another event handler for the closing event will be given the opportunity to cancel the action.
NOTE: This assumes you are talking about a Win Forms application.
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
|
Closing and Closed events only exist as Closing and Close in .NET Framework versions 1 and 1.1 . If you upgrade to version 2 (2005 edition) just be aware that the events have been renamed FormClosing and FormClosed.
|
|
|
|
|
working with VB.NET
help,please. i am fumbling around at this problem for quite a while
i want to store a picture's location on the harddisc in an access-db.
in my prog i use an openfiledialog, get the name of the picture-file from that dialog, show the picture in a picturebox, and path and name of that file in a textbox.
this textbox has a databinding to my access-db. but whenever i open the openfiledialog,
i can't update my database afterwards anymore. when i write path and name of that file in the textbox by hand and update my db, there is now problem. so the databindings work.
does anybody know, whats going wrong here? thanks
|
|
|
|
|
|
Hi,
How to execute DOS commands from VB. I used Shell command but it didn't work.Pls help me with an example.
Ram
|
|
|
|
|
VB6 or VB.NET ? What commands are you trying to execute ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Well, if you just want to execute the commands and exit the command line, you can shell cmd with the /c command line switch. For example, if you want to execute the help command,:
Shell("cmd.exe /c help")
That would work in both VB6 and VB 05, though it's not the best practice in VB 05...
Yuvi Panda T
15 Year old Microsoft Student Partner
Blogs at : http://yuvipanda.blogspot.com
|
|
|
|
|
|
I always use Process, you can actually redirect the input/output...
short example to ping google...
Dim ping As New Process
ping.StartInfo.Arguments = "www.google.com"
ping.StartInfo.CreateNoWindow = True 'this will prevent a window from being created, so the user won't see a flash of a console window opening/closing
ping.StartInfo.FileName = "ping" 'whatever program you want to run
ping.StartInfo.RedirectStandardOutput = True ' must be set to true if you want to get output
ping.StartInfo.UseShellExecute = False ' must be set to false if any of RedirectStandard* members are true
ping.Start() 'starts the application
MsgBox(ping.StandardOutput.ReadToEnd) 'will msgbox the output of ping
|
|
|
|
|
Hi I am working on vb 6.0, I have a textbox on my form and i want to do something when user write something and hit enter key, So please anybody tell me how to track this thing
Thanks
|
|
|
|
|
in keypress event of the textbox ....
' I dont remember in vb6 which parameter come in the procedure. so check the parameter and replace e.keycode with that
if e.keycode=vbenter then
do something here
end if
Rizwan Bashir
|
|
|
|
|
Thanks i got the solution
Actually in vb we do it by onkeypress event in which we can know whether the enter key is pressed or not by the value of enter key ascii value which is 13.
ok
Thanks
|
|
|
|
|
How do I code the listbox select item to not change when the choice is incorrect.
I'm doing a simulation of driving and the listbox has Park, Reverse, Drive and Neutral and you are not allowed to change gears when there is speed my code is allowing the change and I get the message box up twice how do I stop it from changing and only have the message box up once?
|
|
|
|
|
You may disable the listbox:
ListBox1.Enabled=False
|
|
|
|
|
How about?:
If speed > 0 then ListBox1.Enabled = False
|
|
|
|
|
Hey, I've been taking an independant study in Computer Programming, i've been doing VB.Net, and i've had prior experience with VB6/VB5 and C/C++ and a few other non-compiled languages, so i'm not a complete idiot... but i have to come up with some sort of project for my final. which will be due on thursday... anybody have any ideas for something interesting i could do? my friend who is also in the same class is going to do something with TrueVision3D, his will be something like a game where you can construct things...
|
|
|
|
|
Due on Thursday and you want ideas at this point ? That would limit your choices, I would expect....
I hope you didn't mean to imply that C++ is a non-compiled language ?
I would think that your best bet at this point is to start with something where you get a bit of flash from something that VB gives you for free, such as a DirectX sample. If you start with a DX sample and build something out of it, you might be able to save the day. Otherwise, I get the feeling that you're hosed, with only a few days to go.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I thought someone might misinterpret that.... no i meant i compiled languages such as VB5/VB6, C/C++, and in addition some non-compiled (mostly server side scripting languages) such as PHP, ASP, etc.
|
|
|
|
|
Archer282 wrote: which will be due on thursday...
You have left it far far far too late to do anything of any significance.
If you knew, some time ago, you had this "final" to do, why have you given yourself an impossible task so late "in-the-day" ?
At what level is this independant study?
modified 1-Aug-19 21:02pm.
|
|
|
|
|
Well actually i didn't know until Thursday, the teacher never said anything...
|
|
|
|
|
Archer282 wrote: Well actually i didn't know until Thursday, the teacher never said anything...
In which case you had better start "banging tables" to show your disgust and contempt of a system that clearly is handicapping you rather than helping you.
Assuming you have a copy of Microsoft Project software, navigate to where the MS samples are stored and load the sample project entitled "Software Development". Open it and see the data that is presented to you. Then look at the timescales required to effect some software project from inception to end, and what they show there is not representative of real-life project development time.
Say to your teacher if MS Project sample cannot do a software project IN ONE WEEK what chance have you.
modified 1-Aug-19 21:02pm.
|
|
|
|
|
How do you completely RELEASE a bitmap file if you load it as an image?
The following code chokes:
Picturebox1.Image = Image.FromFile("C:\test.bmp") 'load the file
....
....
....
....
Picturebox1.Image = Nothing
Picturebox1.Dispose
Try deleting file here and you get “cannot delete…in use by another user…” error.
???
Thanks.
Carp
|
|
|
|