How could I call a Crystal Report form dialog box when coding in a windows form on Visual Studio 2015? - error-handling

This is my first time linking one form to another. I tried using Load(), Hide(), and MsgBox(); These things do not work. For some of these situations, I got a null reference exception.

Related

How to create vb app as a Microsoft Word right-click menu option

I am trying to make a Windows Form application using Visual Studio in which I right click on a word document, select an item 'pages count' from the right-click menu, and a form will pop up with the number of pages in that document.
Am I right to be using Visual Studio for this?
How do I call "thisDocument" or "activeDocument", and make the document the one that is selected in the menu, if the document is not actually open?
I saw that for application.ThisWorkbook, if it the application is an add-in, it will bring up the application calling it, but I am not quite sure if an add-in is part of Visual Studio?
https://msdn.microsoft.com/en-us/library/office/ff193227.aspx
I hope this question isn't too basic -- all these things sound so similar to me, I'm having trouble sorting it all out with googling and reading questions.
Thanks for any clarification!

RibbonPanel.Visible = False crashes form

I have a MDI (IsMdiContainer = True) Visual Basic .NET form in Visual Studio 2013 which is based on a System.Windows.Forms.Ribbon. It contains several RibbonTabs with RibbonPanels and RibbonButtons in them. If I make one of those panels (containing two buttons) not visible at design-time, I can not load the form at design-time anymore. The code the designer adds at the *.Designer.vb file is:
Me.pnl_accions_llistats.Visible = False
Which produces this error message:
Exception of type 'System.ComponentModel.Design.ExceptionCollection'
was thrown.
Any idea on how to solve that besides removing the offending panel and their buttons? Found that using the offending line at *.vb in the Load event, works fine but I'm worried about the designer crashing that way.
I tried the solution suggested here but Visual Studio didn't show me any error when opening the form at design-time. However, using source control, I could easily identify the designer line of code that crashes the form.
The only solution I found was using the offending line in the Load event at *.vb.

How to find a form from many forms in vb6 on a existing project

I am working on a old project of vb6 which has hundreds if forms. I am able to run the application and have to fix a runtime error in a form which pop up. I don't know the name of the form and only have visual reference. I tried using debug but It has continues SQL statements running in a loop. Any advice is appreciated.
Thanks.
Search the code for the form caption, or the labels of controls on the form, using visual studio's "find in files" or simlar function of your favourite editor.
If the caption is set in the form design, this will take you to the .frm file the form is stored in. You can open this in Notepad or another editor to get the name of the class (which is usually the same as the filename).
If the caption is set in code, you can place a breakpoint on that line. Again, this will lead you to the code which instantiates the form.

Is there a way to locate a code block from a GUI in debug mode?

I'm digging through a program that contains a lot of forms with names that aren't as descriptive as I'd like them to be. I am trying to edit some motor control functions, and in the GUI I am able to reach the form that contains buttons controlling the motor, but I'm not sure where the code is that controls this form. Is there a way to open up the code block corresponding to the form I navigate to from the GUI in debug mode?
Or, alternatively, how can I navigate through the GUI without running it? I know I can right click and do "View Code", so if I could navigate to the form I'd be able to that.
I am using VB.NET in Visual Studio 2010
Go by button text. In visual studio search(Ctrl+F) using the text, visual studio will find the designer.vb file holding the button with the text, once it is done try to look at the design of particular then you can figure out which form you need to look at.
thanks

vb.net 2008 express: Two textboxes in a custom control

I'm making a custom control in VB.net 2008 Express. Without getting into the details, I am able to duplicate the issue as follows:
Make a blank custom control. Stick two textboxes on it. Don't add any code.
Run it and click the second textbox. (Don't click the first.) The text cursor appears of course.
Now Type... Although the text cursor moves within the second textbox, the text you type appears in the first textbox, not the second one.
I have found that this issue depends on the tab order of the controls. Whichever textbox is first in the tab order gets text typed in the other.
I have also found that if you press [Tab] to set focus on either textbox, the problem goes away.
QUESTIONS:
1) Is this a known bug in .net? (Specifically 2008 Express)
2) Will this phenomenon carry over when the custom control is brought into a larger project?
I followed the steps above and was able to reproduce it when I started with a Windows Form Control Library and ran it inside the UserControl TestContainer. I test this in Visual Studio 2008 Professional.
However, when I placed the user control inside a form in a separate Windows Forms Application project, the issue did not occur. So I'd think it's safe to say that this won't be an issue when the user control is used in another project.