While working on a project VB.net project in Visual Studio 2013 Community, i accidently inserted the ToolStripPanel/ToolStripContentPanel controls combination.
Unfortunately however, I now cannot delete it. Can anyone advise as to how to go about doing this? There must surely be a way. Unfortunately, I cant just hit Undo either as the project has been saved since.
Copy the MenuStrip (Default name MenuStrip1) to another form in your project. Go back to the problem form. Right-click the ToolStripPanel, click Select, and then hit delete. This will delete everything. Copy MenuStrip1 back to the problem form, and your original menu should show up. You may have to add the 'Handles' clause back in to any menu events. For example, if you have an event procedure named 'MnuFileOpen_Click' you may have to reinsert 'Handles mnuFileOpen.Click.
Related
I decided to "tweak" an existing database to further manage multiple sources of income.
I copied the working database and created a "modification copy", just in case I messed things up horribly.
In the modified version, I have a button on a form (in fact, two different buttons with similar macro properties, just directed to do the same function to different reports.
The properties are your standard macro with an openreport, and a "where" condition.
Here's the problem. The macro has worked in the past, and continues to work on my "pre-modification" operating database.
On the modified database, after ensuring all the parameter elements are entered correctly, I can change the "view" to report view, and the macro seems to work just fine until I close the database.
As soon as I open the database, the buttons produce an error. See pic below.
The only way I seem to be able to resolve this odd button macro issue is by going into design view and adding a new button. I've discovered...I don't even need to embed a macro, just adding a new button seems to renew the macro operation...until I close and reopen the database. Then, I have to add a new button again to get the open database's macro to operate.
I can delete the new button added, and still have the macro buttons work, until I close and open the tweaked database.
I have zero VBA coding knowledge. I use Access's macro building tools and typically have to visit sites like this if I need to learn a new "trick" to get my database and it's various tools to do something.
I recently explored with the "subform" that can be seen above in the open form pic with the error message. My guess is that maybe that subform is somehow causing my macros to continuously fail???
Thanks for any help!
I am running into an issue after I rename my existing form in Visual Studio 2022. After I rename my form and try to double click a button control in the design window to open it up in the code editor, it doesn't create the event handler.
I tried double clicking the control before renaming the form and it worked just fine. But after I renamed the form, it didn't. I renamed the form in the solutions explorer window, so I am not sure if that is the reason why it's happening?
I haven't had an issue like this before, so if anyone has an idea on why this is happening and how to fix it, it would be greatly appreciated!
You should try checking Form name property if it is correct try Re-build or restart solution.
If u rename then design form , make sure same name reflect in code page also also, if not then rename their also.
I figured out what was going on! I was using WinForms App instead of the Windows Form App (.NET Framework). Switching to the other application let me rename my form with ease.
I recently installed VS 2019 Preview, and i'm facing this issue:
In my VB code editor, in the navigation bar, when i try to choose a class (button, dropdowlist,...) it's not working: the list of classes it's not refreshing, the class i tried to select is not selected, so i can't be able to edit/create an event for the class i need to edit. I manually have to search for the event, or to create it manually.
Is it malfunction of the Editor? is it a bad configuration? or do i need to re-install VS 2019 ...?
Thanks in advance, looking forward for your comments on above.
I am not sure why your chose the Preview edition. I never used it. I have the latest VS 2019. In my version I can choose any control on the form in the middle drop down and the events for that control appear in the right drop down.
Another way to add the stub for an event procedure. Is available in Design View. Select a control and view the properties window. On the toolbar choose the lightning bolt. All the events for that control are listed. Double click on the event you want and the stub will be inserted in the code editor.
Of course, you can always just type in the event procedure, as long as it has the correct signature and handles clause, it will work.
I have a WinForm in a vb.net application. It has between 4 and 7 multiline textboxes. I want to be able to copy and paste information into or out of those textboxes but it appears to be impossible. There is no right-click cut copy or paste available and the keyboard shortcuts do not work either.
The properties of all textboxes are enabled, visible and have shortcuts enabled
Can anyone help please?
Create first a ContextMenuStrip.
Add new menuitem: 'Paste', set the menuItem's ShortcutKeys property to CTRL+V.
Set the (Rich)Textbox -> ContextMenuStrip property to created menu control.
Handle the 'Paste' menuitem click event.
Try the result.
Its seems to be a strange problem.Make sure that you are using the real textbox control and not some custom user control.
It is also possible that the changes you make in designer and code are not written into the exe.When you debug your project, you might be seeing an old version of your program in which the properties might be set to false. In that case you have to simply delete the exe in the bin\debug folder and rebuild your project.
In VB.Net 2010, whenever I delete a menu item on a Windows Form (a Mainmenu1 object), an exception is thrown at run-time suggesting that there is an index value missing -- essentially a "source not found" error. Do I need to go into the Mainmenu1 object on the bottom of the Form at design time and do something? (BTW, I have also tried deleting the source code for the menu item, and then the menu item, and the exception is still thrown).
Basically, something is occurring that is not allowing me to simply delete a menu item, and get a successful run thereafter.
I had this problem. The simple fix is to restore the menu by clicking undo. Then run the code to make sure it still works. When you have done this, CLOSE visual studio. Then open VS and load your project. Delete the item from the menu and run the project. Everything should be fine
I think you need to specify whether you were trying to delete the menu or menu item during run time, or during design time.
You said, an exception, indicating an index value was missing, thrown at run time. I think it might be depending on how you deleted the menu item. You didn't mention how you deleted the menu item.
Normally, when you choose a menu item from a menu at design time, and press the Delete key, it disappeared. And, the program still works fine.
And, another possibility, is that your form window designer and the background designer code is not properly synced.
You might know that, every .NET form objects, have their background designer code, which serves as a schema for everything on the form.
When you add a button onto the form, the Visual Studio add a line of code in the designer code file (normally if your form name is form1, the designer code file is form1.designer.vb or cs or whatever). When you change the background colour of the button, designer code file add a line of code to set the button's background colour.
So, you see, in your case, when you delete the menu item, your designer code file probably didn't successfully remove the code relating to that menu item. So, it throws an exception at run time.
Maybe, it's because of your Visual Studio installation.
So, my suggestion is, you should try debugging the project, line by line, by running the project with F6 or F11 (sorry, I don't remember the exact key, but you can find it in the Debug menu).
I hope I made a good sense for your problem!