How to Lock a form for editing? - visual-studio-2010

Im using visual basic 2010. Preparing a program. In my program when user presses the button on main form, form2 will be shown. While form2 is on i dont want user to make any change on main form. But he must see the main form in the background. There is an example on visual basic program. In visual Basic 2010 when i press tools>options "options window" is shown and when i try to press visual basic main window, a sound comes and options window blinks. So it prevent me to reach main window. How can i do this in my project?

You want to make Form2 modal. That will ensure the other forms remain visible, but inactive. I'm not a VB person but from what I read Form.ShowDialog should do what you want.
Check out this tutorial, it explains the whole procedure.

Related

How to not set focus to CrystalReportViewer automatically?

There is a problem i am facing, whenever I am setting the ReportSource property of CrystalReportViewer, the CrystalReportViewer control automatically steals focus from other controls. Like lets say I have a button I press which has the code to show the report in the report viewer, after this code is done, the CrystalReportViewer1 will have focus now. I dont want this to happen, I want the button to retain the focus. Also setting the focus back to the button is not possible gracefully as the time the CrystalReportViewer1 takes to render the report and set focus to itself is unpredictable, and there are no straight ways to know for sure when CR viewer is done doing its thing, there are some shortcuts/hacks which I dont want to follow.
I am using windows forms visual studio 2015.
Go to Properties of CrystalReportViewer and set
initialFocus = ParameteralPanel.
Please find Image here:

VB.NET Disallowing user to leave form until closed

I'm trying to imitate a feature of Windows. For example, when you're in a folder's properties, and then open the 'Advanced' popup from the properties page; if you try to click out of it the menubar flashes and a windows error sound is made. It is not until you close the popup by pressing okay or cancel or X that you can continue.
I would like to imitate this feature in my VB.NET project, thinking there would be an easy enough way to do this, but I cannot find one.
Show the second form as Dialog from the first form. While the second form is still open, user can't interact with the first form.

working with xamarin code templates

I am trying understand hot xamarin code templates work and how to use it.
By reading the manual it appears the a user can select the code templates by clicking on it or hitting enter on it. Just like in eclipse and intellij.
But this seems not to work the same way in xamarin.
For example after I typed "try" in the editor and hit ctrl+space to get the code complete. Now I am presented with options to select. When I select try and click or hit Enter on it nothing happens. The code complete window just closes and the template is not added.
The animated gif demonstrates it with the mouse click event. But the behavior is the same for key events. Also no matter what I template I select it is never pasted.
You need to press tab key after you have selected the text. You basically have to press tab - tab. The first tab will complete the try text in your example. You may have only typed in t or tr. The second tab key press will expand the code template.
The behaviour is similar to Visual Studio. The difference is that Visual Studio gives you more information in the completion window that appears telling you that you need to press the tab key twice. Screenshot from Visual Studio is shown below.
With the screenshot above pressing tab once will close the completion window but not insert the code for the try template. Pressing tab again will insert the code template text.

MFC Radio button freezes entire screen

I'm a bit at a loss here. Simply put, i created 2 radio buttons on my MFC GUI (vs2010) via the toolbox. I put each of them as a group so i could use the wizard to create a member variable for them. At this point, i run the code to test functionality. I don't expect much to happen since i don't have any handling code for the clicks, but what does happen is my entire screen freezes. So i click on either of the radio buttons, it shows that it is checked, but after that, i cannot click anything else on the screen. It has basically become frozen until i restart the program.
Has anyone seen this before?
.h file entry:
CButton testRadio;
CButton testRadio1;
.cpp file entry
DDX_Control(pDX, IDC_TEST_RADIO, testRadio);
DDX_Control(pDX, IDC_TESTRADIO1, testRadio1);
i know that the control ID's are not repeated, so that is not an issue.

How to turn off creating events when pressing enter in VS Windows Forms designer?

I frequently find myself accidentally clicking enter when I'm laying out a form in Visual Studio. Whatever the focus is on when I accidentally hit enter, an event method is created in the code.
And you can't just delete the method because its defined in the designer file so you have to go in there and remove code from the designer. I don't find the Enter = create event functionality to be useful in the designer. Is there a way to turn that off?
I seriously doubt it, no config for this in Tools + Options. But be sure to use the normal workaround: type Ctrl+Z, it works. And Y to dismiss the "are you really sure" message box.
If you just press Ctrl+Z,Y, any other unsaved changes you've made on the designer window (such as adding or moving controls) will be lost.
If you type Ctrl+Tab (to return to the designer window), and then type Ctrl+Z, only the insert of the empty event handler will be undone - other changes will be preserved.

Resources