open .chm file from my.resources when a buttons clicked - vb.net

I already have this code from another question on this website.
Help.ShowHelp(ParentForm,
("C:\Users\Beaudean\Desktop\Help.chm"),HelpNavigator.TableOfContents, Nothing)
That works fine except i need the location of the chm help file to point to "my.resources" where it exists because i need to install my program but in that code example it only works with strings?
Thanks you :)

You cannot make this work. The .chm help file viewer is an external program, hh.exe. It doesn't know anything about managed resources, it needs a .chm file on disk.
Setup your project so that the .chm file is available in your build directory. Project + Add Existing Item and pick your .chm file. Select the added file and set its Build property to Content (so it gets installed with the rest of your files) and its Copy to Output Directory to "Copy if Newer" (so it gets copied to your build directory).
And modify your code so it can always find that file:
Dim path = System.IO.Path.Combine(Application.StartupPath, "Help.chm")
Help.ShowHelp(ParentForm, path, HelpNavigator.TableOfContents)

Related

How to Create .cmake File

I was working on a project which requires me to add a user.cmake file in the root directory. Can anyone help me out hot to create the .cmake file...
Link to Project Directory
According to the link you provided user.cmake just needs to point where so-called eego sdk is located in your file system:
set(EEGO_SDK_ZIP /path/to/download/eego-sdk-1.3.19.40453.zip)
There is nothing fancy actually here, just make a plain text file, put this one line (don't forget to replace the EEGO_SDK_ZIP variable content) and save it with the name user.cmake

Do I need to check in vbproj file in TFS when I add a new image in the solution?

I have added a new image in the web folder and my .vbproj file reflects that change as
Do I need to check in this .vbproj file as well in TFS to reflect this change or not required? Please advise as I am trying to know the process.
The VBPROJ file contains a reference to, among other things, each item that belongs to the project. If you don't check in the project file after that change and then someone else syncs or you restore from your repo then you will get that image file in your project folder but it won't be part of the project, so you won't see it in the Solution Explorer (unless you click Show All Files) and it won't be included in the build process.

Include and Call PDF File in vb.net (after Deployement)

Glad to see this site, Thanks guys for being active. :)
I have a problem in Visual Studio 2010/VB.Net
I have windows form in Visual Basic, I deployed the software(form) to one installer
Now I want to open My PDF file( i-e: Specific) with Button_Click_Event
I know that:
Process.Start("MyPDF.pdf")
But I dont know if user install my software in his PC so may be he install the software in C D or other directory, and also I dont know How to include PDF file in my project :)
Please suggest for me, I am searching this every where but failed so pl help me
Use Add->Existing Item on your Project. Then add the PDF File to your Project.
Afterwards you have to set the Properties of the newly added file to the following:
Now the file will be added to your "Output" Directory after you build your Project.
Now use your Process.Start("MyPDF.pdf") call. It will open up, as it resides in the same directory.
This is rather easy:
Simply include the file by dragging it to your project folder and in its options, tell it to copy to the build directory.
Thereafter, find the path through the my.application methods.
Build a correct path from that and launch it via process.start

How to get full file path?

I need to get VS application path.
Hi! In my windows forms application I had added a image file.
Now I want to get the full path of this image file.
Any idea how can i implement it?
As Cody Gray pointed out, if you have added the image as a resource, you can access it in code via the applicable image property in the My.Resources class.
However, if you have added the image file as just a regular file included in your project, you need to set its "Copy to Output Directory" property to either "Copy if newer" or "Copy Always". That way, the file will be copied to your project's bin folder when it is built. Then your code can find it by looking in the executable folder. You could just assume it's in the current directory, but it would be safer to use something like system.Reflection.Assembly.GetExecutingAssembly().Location to get the full path.

How can we access the files in the Data Folder when we publish the Vb.net application

I have added some files that I need to be downloaded to the Application start up path. So I set Build Action as content now the files have been copied some where
C:\Documents and Settings\TestUser.ANNAM\Local Settings\Apps\2.0\Data\HVDRBMY5.8AA\858AT9VM.TNP\test..tion_2d7cfc137d9c2c74_0001.0013_432bd4561850d290\Data
How can access file from the application. My problem since it is a dynamic path will it be same folder count so that we can use like ..\..\Data\ Some think like this
Application.UserAppDataPath gets the path for the application data of a user.
Application.StartupPath gives you the path for the executable file that started the application, not including the executable name.
Starting with one of these, you should be able to use System.IO to manipulate the paths until you get the folder where your data files are.