vb.net add icon to form title bar - vb.net

This is a Visual studio 2019 WinForms project on a Windows 7 64 bit machine
I know how to use the Properties to add an icon but if the icon is to be embedded with the EXE file that is not the process to use. I have also created a folder named Resources and place the icon in the folder not sure that is the best idea based on the EXE might not include the folder
Here is what I have tried Right Click Project > Properties > Application > Icon ComboBox > Browse
Select the icon which is named s.ico and is 32 X 32
I also tried to cut and paste from the solution explore to the Debug folder BIG MISTAKE
Now I have no Release folder ?
The question is this the correct process ?
Do I still need code to make this icon show on all the project forms ?
One form does not have a title bar
OK I am adding to this Question
I created a test project with only a form. textbox and button
I added a icon to the button and it shows when the project is run
For some reason when I added the icon to the button a Resource Folder was created that contained the cat.ico I DID NOT CREATE the FOLDER( See New Screen Shot )
Now I followed the steps to add an icon to the titlebar NO LUCK
Here is where I have no idea what is going on
If I right click on the two icon files One says the Build Action is "content"
If I right click on the other icon the Build Action is "None"
I see the option to select Build Action "Embedded Resource"
Question What does Build Action do?
And if "Embedded Resource" is selected does that mean the file is included in the EXE?
New Screen Shot

I am not sure this is a good way to solve the question
WHY because I do not understand how the code works BUT IT WORKS
Here is what I did I Right Click Project > Properties > Application > Icon ComboBox > Browse Select the icon
The icon in question is in the project > See the Screen Shot
Then I added this 7 year old code I found on SO
Stackoverflow Link
Icon = Icon.ExtractAssociatedIcon(Application.ExecutablePath)
OK So now someone please explain how this works ?
Based on my limited knowledge I would say this will include the icon in the EXE file

(Project > Properties > Application > Icon ComboBox > Browse
Select the icon)
this indeed is the right way to select an icon for your project.
The icon will be found after that in your project folder not the debug folder.
After debugging your Project it will be embedded with it and the EXE file icon will be changed to the selected Icon.
No need to add it to the resources.
Finally, to set the same icon for all your forms, take a look at this topic:
Set same icon for all my Forms
or of course, you could change it manually one by one in the (properties) menu, in (Icon), then browse to your Ico File.

Related

IntelliJ does not export to exe

I have seen many guides where artifacts menu contains Native bundle field. But I don't have it. Moreover, after building the project, the EXE file doesn't appear in any folder. See pic
The option is there but the bottom panel hides it. Please resize the panel and you get the option back. There is similar report on YouTrack: https://youtrack.jetbrains.com/issue/IDEA-183544

Using a 3rd party control

Please excuse the noobness that is probably about to follow...
I'm making an vb.net 2010 app which needs to have a calendar system in which the user can add appointments and events etc.
I've downloaded the source for a control which looks promising (http://www.codeproject.com/Articles/10840/Another-Month-Calendar) but I have no idea how to add this in to my project. I've googled for help on adding the control but have had no luck.
If I right click on my toolbox, go 'choose items...' and try and add it there, it tells me it couldnt be opened.
Any help is appreciated!
Well you've downloaded the source code.
Place the source code in a specific location on your pc and then compile it 9If your planning to use this control in your own project then compile it in release mode. Assuming that there are no compile errors close visual studio and then open up the project of your own that you want to use this control in.
Right click on the general tab in the toolbox and click choose items. Using the bowse button in the choose items dialog navigate to the folder in which you placed the source code for the control you want to use.
Now locate the 'Bin' folder and in that locate the 'release' folder. Inside that you will see a dll (named presumably something like MothCalendar.dll. Select that dll and then click add and OK (Button sequence will vary according to vs version). The control should then appear in your toolbox under the general tab and you should then be able to drag it onto your forms for use in your project.

Icon is not shown in the taskbar

On other forms, the icon is shown in the taskbar but only in this form, the icon is not shown in the taskbar.
I also made sure that there is an icon in the form's property.
Right Click the Project file and Select Property as follows
Now Change the default Icon here
Have you run the program from the exe in the debug/release folder.
I've found that the icon doesn't show in the taskbar when run from the debugger.
Edit: Just realised how old this is.
Well, hopefully this will help someone else.
To change the main icon for your application, go to the "Application" tab under the project property page, and change the "Icon:" combo box.
You can change icon form from properties form like this picture.
You need to change icon of application from Project Properties -> Application -> Icon
In properties of the form, browse for an icon in the icon tab.
Make sure that the picture you are using is in .ICO format. Sometimes, in newer versions, the language accepts images other than .ICO format but can produce error and doesn't display correctly everywhere.
Make sure that the .ICO you have converted is in more than 1 or 2 sizes (.ICO files have many resolutions in just one file).
I hope you understand!
In addition to other answers here, make sure that the 'ShowInTaskbar' property on the form is set to true. Sometimes settings get toggled. Toggle it back.

How can you tell where your solution is opened from?

I have a VB.net solution that I made a complete copy of and placed on a different drive and now I cannot tell which solution I have been working in.
Is there a way I can tell where my solution was opened from?
In the Solution Explorer pane, right click your Project (e.g., WindowsApplication1), and select "Open Folder in Windows Explorer" from the menu that pops up. That way you can see the actual directory it is stored in.
When the Project is selected in the Solution Explorer, you can see the full path of the containing folder in the Misc > Project Folder property in the Properties pane.
F4 will display the Properties pane if it is not visible.
For a Solution, the Misc > Path property shows its full path.
And, similarly, the Misc > Full Path property shows a file's full path.
And emphasising these Properties are only valid when the Solution Explorer was the last pane that was active.
You can also hover over the project name in the recent items in the Start page: that will show the project's full path on the status bar.

How to automatically navigate to current class in IntelliJ IDEA Project Tool Window?

I would like to have a keyboard shortcut in IntelliJ IDEA that has the following effect: the tree in the project tool window expands to show the currently open class (or file), and this class becomes selected in the tree.
Is this possible?
Navigate (View in older versions)| Select In... (Alt+F1), Project View (Enter).
It's also possible to enable Autoscroll from Source option in the Project View so that current file is automatically selected.
IntelliJ IDEA 2019
Left click on the wheel > Always Select Opened File
There is also: Open Files with Single Click - the selected file from the tree view will be opened in the right side.
Old IntelliJ versions
Right click on Project/Packages area > Autoscroll from Source
or
Left click on the wheel > Autoscroll from Source
There is also: Autoscroll to Source - the selected file from the tree view will be opened in the right side.
Try
Alt F1(Select Target dialogue) + Enter.
Click at this icon on the top of tree-box.
you can do this also using the upper dynamic menu that change for every opened file. just click twice on the last folder and the file will be on the same folder branch
also good for pycharm
You can also make your own key combo to the "select in tree view" via prefs. I often do: shift + cmd + a and then just write select in.. and then press enter.