I have made a program in Visual Basic and I want to add this program in user's start menu by code. How can I do that?
I know that there is a folder in
C:\ProgramData\Microsoft\Windows\Start Menu\Programs
where I can add my application's shortcut, but I think I have, also, to write in user's registry.
And that's my problem: I don't know what to write in registry in order to add app in start menu. A simple location in registry will help me if you don't know vb code.
Related
I am making a little program and I need to be able to remove the Lock attribute from all files (no matter the extension of those files) in the specified directory. I haven't find any way to do so on the web so far, so I really have no idea how to start a basic code for that job, so all I can really do is give you the elements of my Windows Form:
txtDirectory: This is where the directory is being
displayed/selected. All files in the displayed directory needs to be
getting the Lock attribute from them - see btnConfirm to know more.
btnSelectDirectory: This button opens the directory seletion
dialog. This section does not need any code - but feel free to add
code if you think it could improve my program.
btnConfirm: This
button is where, when clicked, all files in the specified directory
will be removed from the Lock attribute. This is what I really
need help with.
How can I do so?
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.
Just noticed a file named ApplicationEvents.vb in my vb.net project in the solution explorer, its empty...
Where would this have come from? is it safe to delete?
It is a file that can house common Application events like Startup and Shutdown. This is a partial class, so it would get compiled in when building the solution.
If it is empty, then it is safe to delete, but if you ever want to handle these events, then this is where you can easily hook into these events.
Read How to: Handle Application Events (Visual Basic) for more information.
Im using visual studio 10
The applicationevents.vb is not safe to delete if its empty. The project will fail to build properly because the file is missing. The project has some kind of internal reference to the file if you have created it. By default this file is not included unless you have clicked the "Application Events" button on the application tab in the project properties....
what I really want to know is why is mine blank....
I want to make some small modifications to the default control template of some controls in my windows phone 8 app. The problem is that I can't find these default templates. Anyone know where they can be found?
I am looking for something like this, but this is for WPF and not WP8.
Thank you
You can find the file containing all the default control templates here:
C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Design\System.Windows.xaml
Edit: also, the Windows Store Dev Center has a lot of them listed if you search for "styles and templates"
I'm not aware of such a listing for WP8, however, you can use Blend or Visual Studio to edit a copy of a control's current template by right clicking on the control and then selecting Edit Style, Edit Template or Edit Additional Templates as appropriate. In the submenu, you can select Edit a Copy... which will present a window that allows you to create a copy of the default (or current template/stlye if you have already modified it) and customize it.
I am trying to add a feature to my msi based installer, written in wix, which will allow the user to change the name of the folder that keeps the shortcuts within the Windows start menu.
What I did so far is to add a folder there (with a static name), add shortcuts to that folder and remove all of them during uninstall (by using the RemoveFolder tag). Then I added a custom action that will pick up the property that is set from an edit box in UI and set that as the name of the folder, something like:
By running this within the InstallExecuteSequence, the folder is created correctly (with the name the user set for it) and all things are set into place. However, when I uninstall the product, the folder remains with all of it's shortcuts in it (that point to nothing now and they ask for deletion when you click them).
Is there any way to remove a folder that I dynamically changed it's Name attribute during installation, as described above?
Thanks.
You'll need to save the dynamic property to the registry, and read it back during maintenance/repair/uninstall. Windows Installer doesn't "remember" property changes, you need to do it yourself.