Show Form Shortcut Key
Nov 8, 2009so I've got a button that hides my form, and I was wondering, when my form is hidden, is there a way to make a shortcut key that shows the form again? I'm hiding it using Form1.Hide()
View 3 Repliesso I've got a button that hides my form, and I was wondering, when my form is hidden, is there a way to make a shortcut key that shows the form again? I'm hiding it using Form1.Hide()
View 3 RepliesI'm having problems to create a shortcut key to show another form.
For example, If i will click F1 another form will pop up. Kindly check the codes that I used.
Private Sub Form6_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
txtDate.Text = CDate(Date.Today)
End Sub
[Code].....
Private Sub FavoritesToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles FavoritesToolStripMenuItem1.Click
FavoritesToolStripMenuItem1.Visible = False
[code].....
I am having troubler with hide/show commands, First I did this
Private
Sub
FavoritesToolStripMenuItem1_Click(ByVal
sender As
System.Object,
[Code] .....
Now I can't have my shortcut because there is two things that use the short cut so can I do a command that hides the shortcut and enables it when I click on the favorites?
I'm trying to extract the icon from a shortcut (lnk file), but I end up with the shortcut symbol in the lower-left hand corner of the image. How can I extract a shortcut's icon without this symbol?
Here's the code I'm using:
Dim ico As System.Drawing.Icon = System.Drawing.Icon.ExtractAssociatedIcon("C:shortcut.lnk")
How could I create a keyboard shortcuts to call some of the functions on my form? For example, I have a media player that opens media files:
Private Sub Button_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button.Click
OpenFileDialog1.ShowDialog()
[code].....
may i know is that possibleto assign the form a shortcut key like crtl 0 to load/open the form?
View 2 RepliesUsing VB.Net (Windows Application)
In the Form, textbox, combobox etc....
-> When i open the windows form, if i press ctrl + Enter, then pop windows is opening
-> if i enter any data's in the text box, then i press ctrl + Enter, then pop windows is not opening
Code
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.KeyPreview = True
End Sub
[Code]....
When the form load, ctrl + Enter shortcut key is working, once i enter or select any data's in the form, then ctrl + Enter shortcut key is not working (not showing the popup windows)
I want to press for ex: "F12" and will show for ex: "msgbox".I know how to that with keydown but I can't use this outsite my application..
View 6 RepliesIs it possible to drag an drop a desktop shortcut to the form and then launch the program from there ? Is so how would this be done ?
View 39 Replieshow do you show information from a datagrid cell to show up in a text box in another form, this is for a college project.
View 1 Repliesi'm creating a program in visual basic and i want to have a shortcut key that opens up another form even though my application is not the foreground window
View 1 RepliesScenario:I am attempting to perform some work on files (rename/delete) in folder, usually in a network location. Because the location of products folder is not critical, it's rarely ever in the same place on different networks. A simple shortcut on the client machine is all that's required from the client perspective and the rest of the product is self contained on the server somewhere. To run the 'fix' my small application will perform quickly and easily, I need to parse the path held in the target box of the .lnk. Then perform ifexists for a specific file and then do my renaming/deleting.
To keep it as simple as possible, the end user should just 'drop' the shortcut onto my form then click 'fix'.The problem: How in the heavens can I retrieve the target location from the .lnk into a string without windows scripting host?
Im trying to create a program that will be using a shortcut key in displaying a form. But im having problems on how to know if the cursor is on the textbox or datagrid.For example, If I clicked the textbox, and i clicked f1, Customer List Form should appear. No problem with this. I used the following
If txtCustomerName.Focused = True Then
If e.KeyData = Keys.F1 Then
Form9.ShowDialog()
End If
End If
But when I Clicked the cell on the datagrid, and click F1, Product List Form should appear. This is my problem, the form is not appearing when i click f1.Here is my
If dgvSalesEntry.Focused = True Then
If e.KeyData = Keys.F1 Then
Form8.ShowDialog()
End If
End If
I'm new in .Net and I have an application with windows form "LOGIN" When users enter the user and password and click "ok", then if user passes validation then I have the code Show(MDIMainMenu) (I'm trying to open an mdi form), but I receive the following error: "Form that is already visible cannot be displayed as a modal dialog box. Set the form's visible property to false before calling Show. Error Number 5"
[Code]...
I have a program that uses two forms. The program opens to the Main form, and the user can navigate to the other form from the Main form through use of a button. Here's the way I've currently written it: When the Main form loads, it declares and instantiates the other form during the load procedure. When the user presses a button, the second form is displayed by means of the ShowDialog method. On the second form, there is a Return to Main Screen button which closes the second form, bringing the user back to the Main form.
So, here's the structure of the code:
Code:
Public Class frmMainForm
Dim frmSecondForm As New SecondForm
Private Sub btnSecondForm_Click(blah, blah, blah) Handles blah, blah, blah
[CODE]...
Here's my reasoning: Originally, I wrote the code so that a new instance of the second form was created every time the button was pressed. The problem was that whatever data was displayed on the second form, previously, was lost when the user returned to it a second time. Since the user would be switching back and forth between these forms, frequently, I needed that data to persist.
What is the best practice for accomplishing this:
1) Declare and instantiate the second form on program start, as I have done, and use the button simply to show the form?
2) Declare and instantiate the second form each time the button is pressed but maintain the variables on the Main form and pass them ByRef to a custom constructor for the second form? Is this even possible?
3) Something else?
Im trying to create a stopwatch in one form and another form show my progress bar using a combo box for mins and seconds to show the progress bar on form1 1
[Code]...
I am trying to use a progressbar to show on main form and then finish when next form is loaded, I have got this code.
1. When I click on button, it must open next form, but the next form must only open when the data in my list box has been loaded from Access Databse. When I run my program, it only shows the progressbar and don't open the next form.
Main form code:
Public Class Main
Dim PB As ProgressBar
Private Sub main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
[CODE]............................
Using the code below:
Private Sub ShowDropDown()
Using f As New DropDownForm
f.Visible = True
Do While f.Visible
Application.DoEvents()
[Code]...
This was a guess, after looking at the Form.ShowDialog method in reflector.My question is, is there a managed call I can make to acheive the same result, and what does a button click do that other clicks don't?
ETA: The problem does not occur if I open the form using a key.
This is a database app where I am trying to check for possible duplicates and give the user the option to keep the new record or assign to an existing record.In form1 the user will enter data into a textbox. I use this information to build a bindingsource.filter. Then I call another form (form2.show()) to display results to user and get user response. This part all works correctly.
The problem is that as soon as form2.show() executes, I loose the contents of the textbox - and it appears that I am no longer in the bindingsource.addnew() method.
Iam creating an application. i have a main form it has 5 buttons i have created 5 more forms. my aim is to show a particular form for every button the form is opened in a new window i dont want to open in a new window it should be embed in the main form when i click anthor button it will show the related form in place of previous form
View 2 RepliesIam creating an application.i have a main form it has 5 buttons i have created 5 more forms.my aim is to show a particular form for every button the form is opened in a new window i dont want to open in a new window it should be embed in the main form when i click anthor button it will show the related form in place of previous form?
View 1 RepliesWhen I use
Me.Close()
Form1.Show()
It closes the whole app.
How would I change it so that it only closes the current form while opening a new one? EDIT: I put [Not Resolved] Because I accidently pressed the resolved thing
i used to write the code to show another form and unload the current form it always told error on UNLOAD form2.show unload me Do i have to use the code :
.Dispose()
or is there another suggestions
I have two forms , and I want write a code like ( form2.show=true & form1.show.false)
View 2 RepliesI have a series of methods being called for my networking code. An event gets fired from the networking thread. Inside this event, which I've hooked into from a singleton class, I route messages to form level methods which they register on form load to handle certain messages they care about. Inside of these form message hooks I need to close the current form (which I was able to do) but also show a different one (which is giving me the trouble).
[Code]...
I want to use a form in vb.net 2010, so when I click on a button ,it must show me the info of a specific row in Exel and display info of that row in a text box.
eg.
Name Surname phone
Koos Leeds 08212122392
How do I start with this, any samples.
why I need to instantiate a form instead of form.show?
View 20 RepliesPrivate Sub HideShowTest_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Hide()
[code].....
I have a dual monitor setup on my computer. My program has multiple forms. I've designed the program to check which monitor the main form is currently on and to open the secondary forms on the current monitor. When the main form is on the primary monitor the secondary forms open as FormWindowState.Normal which is the design-time setting for the secondary forms. If the main form is on the secondary monitor and I click to open a secondary form then the secondary form is to be displayed as FormWindowState.Maximised.
[Code]...
So I moved the Form.Show line to after the Form.WindowState line. This works fine when the Form.Show process is very quick. The problem is that one of the secondary forms downloads some information from the internet so it takes about a second to finish the Form_Load process. When I had Form.Show first the form would not appear on screen until the Form_Load process is complete, so the delay was in the form appearing at all which is how I prefer it. With Form.Show last the form appears on screen immediately but appears mostly blank and unresponsive until the Form_Load process completes.
I would prefer that the form not appear at all until the Form_Load process is complete but I would like it to appear in an already Maximised state. Is this achieveable? It doesn't seem that complicated but I just can't figure it out.