How can I add a Window to my Visual Studio? - visual-studio

I created an Add-in project and now I have this in my solution explorer:
Do I just add right click the solution and add a Windows form? I'm not sure how this works and the tutorials I find don't touch on this.
Thanks.

You can right click the project file under the solution file and select add new item. Btw it looks like you have a missing reference for "Microsoft.CSharp though; that will need to be resolved or removed from your project.
Here is how you instantiate a form and show it in the most basic sense.
Form f = new Form();
f.Show();
Hope this helps.
Enjoy!

Related

Cefsharp Visual Studio Get Link Url

I am building a web browser with visual studio cefsharp. I have been struggling to find a way to find the url of a specific link (on an action like right-click or mouseover). In other words, when I right-click a link, I would like to store the url in a variable. I found this: http://magpcss.org/ceforum/viewtopic.php?f=17&t=12635
Which I believe would solve my problem but am not sure how to use it. If anyone could explain this link or suggest a new solution, I would appreciate it.
Thank you.
I'm using CEF, not CefSharp. So I'll try to guess how it is going to work in CefSharp. When you right click anything in the browser the context menu shows up. There is a way to create a custom handler for the context menu. This tutorial has some details.
The 4th parameter of OnBeforeContextMenu is IContextMenuParams. If I understand your question correctly you are looking for LinkUrl property.

_ViewStart and _Layout.cshtml files are automatically created in ASP.NET MVC 5 (annoying)

I am having a Weird and annoying problem. In my ASP.NET MVC 5 project, time to time, I see that _ViewStart file and Shared/_Layout.cshtml files are created automatically even though I did not want. So, I deleted those files but these files are getting created time to time by itself. That cause a great problem because, sometimes, if I dont notice that these files are created, I can accidentally publish the website and then, after publish, I notice that all pages are being wrapped by the auto created _Layout.cshtml file. Is it a smart helping feature of Visual Studio 2013 ? Cant we stop this ?
Emran!
I am not sure that you still need the answer but today I have also met similar problem. By some unknown reason file "Shared/_Layout.cshtml" was automatically added to my Project.
I was realy wondering why could it happen and I found which actions should be performed to make this file be created.
I have added new View to my Project and have used for it standard VS resources:
Right mouse click on Views folder.
Add -> Veiw...
Inside window for adding view I have checked "Use a layout page" and have left field below empty.
Press Add
My VS was thinking a lot and suddenly created new view and also... "Shared/_Layout.cshtml" and "Shared/_ViewStart.cshtml" files!! I do not think that this option might be switched off because it is logically to create layout page when it has been missed.
Hope this info is helpful for you and for anybody else :)

How to hide excluded files in visual studio?

I have a project with hundreds of pages classes and controls. many of them are excluded but as they appear in the project browser they clutter it and make it difficult to find the files I need. I don't want to delete them since every once in a while i get back to them for review. is there any way to show/hide the excluded files with a button toggle?
I don't have the button for show all files. see picture:
Yes, there is a button to hide/show excluded files.
The button is under solution explorer tab.
Please check this link for VS2008:
http://blog.brianhartsock.com/2009/09/14/visual-studio-tip-show-all-file/
Important Update:
After trials on VS2012 I found out that if you create New Web Site the hide/show button will not appear for no apparent reason. However, if you create New Project the hide/show button will appear!! So, it seems that you have to avoid creating New Web Site... but create New Project instead to have the button on Solution explorer. Try moving your work to a New Project rather than your current solution Good Luck!

How to add a custom icon to Setup Project in Visual Studio?

I am trying to add a custom icon to setup project. So instead of standard installer logo I have my custom logo.
To make it clear, here is the icon, which I want to change:
Right-click the Setup Project in Solution Explorer and select View > User Interface.
This will display all the screens of the installer.
The picture that you want to change is the property BannerBitmap.
You can customize this for any screen of the installer.
Just to add to dhirschl's answer ... you also have the option to change the default BannerBitmap so that all your setups have your own logo automatically and you don't have to worry about fixing it every time you create a new setup.
Clear instructions on how to do this are provided by René van Bemmelen and can be found here on the Microsoft forums.

Extending VS 2010: to include additional items on Right Click context menu (add) on solution explorer?

I wish to create an additional item on the context sensitive right click "ADD" on the solution explorer in vs 2010.
Basically it currently looks like this
New Item
Existing Item
New Folder
Add ASP.NET FOLDER // ACTUALLY THIS IS A MENU with a SUB MENU
Class
What i am trying to do is create a new item similar to "Add asp.net folder" hence it will have subitems
Basically it will be something like this
Add JS items
Add new model
Add new plugin
Basically clicking on "add new model" or "add new plugin" will create a new file UTF-8 and include in the project. It will contain some default code.
I am having a real issue trying to find a good example of how to do this.
Any ideas where i should look?
Anybody seen anything similar?
THanks in advance
Here are some docs to point you in the right direction.
http://msdn.microsoft.com/en-us/library/bb165473.aspx
http://msdn.microsoft.com/en-us/library/bb164699.aspx
Basically commands and menus work the same throughout all of VS, one tricky part is just finding the right Guid of the parent menu that you want to hook in to.

Resources