I have this code and I need to add a shortcut key (CTRL+B) for this function
If I Press (CTRL+B) this function should be executed..
How to add it ...? and how to call this function?
Here is the part of the code and I have also attached full source code with it..
Private Sub Brwse_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Brwse_Button.Click
Dim RetVal As Integer
Dim FolderName As String
FolderName = ""
RetVal = FolderBrowserDialog1.ShowDialog()
FolderName = FolderBrowserDialog1.SelectedPath
If Not (Trim(FolderName) = "") Then
LogLib_TxtBox.Text = FolderName
+turn keypreview on (property of the form)
+in the keydown_event, add the code to test if the control key is pressed and the b key is pressed via the 'e' argument of the routine
+if so, call brwse_button_click(nothing,nothing)
typically however, you also give the user a "hint" that the hot-key is available via a menu item or someother means. if you use the menu item, then you can assign the hot-key there.
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
'Life's real failure is when you do not realize how close you were to success when you gave up.' ~ anonymous
In addition to what nlarson said, move that code you want to call to its own sub instead of putting everything in the button handler. This will allow you to call the code from anywhere in the form without passing in arguments you don't have.
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
I'm new to the programming world, but not the computer world. Anyway, I've just recently downloaded Visual Basic 2008 Express Edition, and so far I love it. However, I came across an old source file that's opensource on SourceForge.net and downloaded it. I was trying to upgrade the Project1.vbp using the VB2k8 Express upgrade wizard when it told me that the upgrade failed because the mdlFormHandling.bas file was missing. The problem is, I went into the folder and looked and it's not missing. It's right there. I took some screenshots to show you if anyone could please, please, please, please help me. I'm just a lowly college kid! No money for the big guns yet! >.<
I've got and tried to track through that filepath and.....nothing. I've done a system wide search and I don't have a file labelled "VB98" to try and find and get into to follow the rest of the path. I'm completely at a loss here. I thought that maybe it was looking for a library I didn't have so I went online and downloaded the libraries for VB2k8EE from microsoft's website and installed them, but unfortunately, I'm still having the same trouble....I can't copy the file's into the location because the location it's looking for them in doesn't seem exist and I'm not even sure what the full filepath would be because it gets cut off with the "\...\...\...\VB98\" and etc...I thank you for your response though.
thanks =)) its solved. as i run the code in macro it does not work but when i change it to a button it works =)) thanks for all the helps guys.
anw can i have some comments, my boss wants me to programe a excel programe to help them generate report. do you think i should do in spreadsheet or forms. which one would be presentable and more interactive??
I tend to use the Forms, sometimes just have a macro to call it.
(eg, Ctrl Q to call the form).
I find them easier and more adaptable.
Obviously for simple things like a column transfer or a set of create and save Sheets etc a Macro is easier, especially as you can use the recorder.
It really is a matter of choice, but I think the Forms a) look more professional, and b) imply you have done more work(even if you haven't), so it is better for workplace kudos.
Are you asking if the form can use data from the spreadsheet, manipulate it and then move it back to the same or different spreadsheet?
If so, then yes.
Something like ...
Dim Something as Int<br />
With ActiveWorkbook<br />
Sheets("Name of worksheet").Select<br />
Range ("A1").Select<br />
Something = Selection.Value<br />
Range ("B1").Select<br />
Selection.Value = Something<br />
Of course you can choose different sheets and manipulate the data or other things as required, this was just a simple example.
I am developing crystal reports in vb.net and used MS Access as database having password security, when i want to view reports in project it asked for password of database.
Now i want to avoid that step, so what kind of coding required to pass username and password to crystal report?
Hi Guys, is there a simple code that I can use. I have a database and I collect information using a query and I want to see all the columns that are in the query when I use a combo box drop down. I am a newbie to visual basic
Last Visit: 31-Dec-99 19:00 Last Update: 2-Dec-22 9:50