Lanc1988 Posted December 5, 2003 Posted December 5, 2003 I am trying to make an install wizard for my program, which i have completed, but now im trying to figure out how to write the code for App.Directory thing. What im trying to do is that i have a list box and a web browser, when they click the item in the list box it displays in the web browser, but since i will be letting many people download my program, they might have it installed to a different directory than C:\Program Files\My Program so thats why i need this. My friend has vb 6.0 and he used something like: Private Sub List1_Click() Dim directory As String directory = App.Path & "\Quests\" WebBrowser1.Navigate (directory & List1 & ".htm") End Sub And so far i have got to down to this: Dim directory As String directory = App.Path & "\Guides\Quests\" AxWebBrowser3.Navigate(directory & ListBox1.Text & ".htm") but i cant get the App.Path to work, it says that "app" is not declared. Can someone please tell me whats wrong with my code? Quote
Leaders dynamic_sysop Posted December 5, 2003 Leaders Posted December 5, 2003 you need Application.StartupPath eg: AxWebBrowser3.Navigate(Application.StartupPath & "\" & ListBox1.Text & ".htm") Quote
Lanc1988 Posted December 6, 2003 Author Posted December 6, 2003 ok, thx alot that should really help me alot. Quote
Lanc1988 Posted December 6, 2003 Author Posted December 6, 2003 i have a slight problem.. now when i click the item in the list box it says "page cannot be displayed" in the webbrowser, then i click on other items in the list box and it says the same thing. any ideas? Quote
Administrators PlausiblyDamp Posted December 6, 2003 Administrators Posted December 6, 2003 Are the files in the same folder as the application or in sub-folders? If they are in sub-folders you will need to append those to the StartUp path as well. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Lanc1988 Posted December 6, 2003 Author Posted December 6, 2003 yes, i added the part for the subfolders. It works perfectly now, thx everyone. Quote
Lanc1988 Posted December 6, 2003 Author Posted December 6, 2003 I have one more problem and that is with using pictures. Can someone tell me how to make that code work for PictureBox? I need it to do the application path thing also. Thanks. Quote
Lanc1988 Posted December 6, 2003 Author Posted December 6, 2003 heres some info about it: PictureBox1 Treasure.jpg Quote
Lanc1988 Posted December 7, 2003 Author Posted December 7, 2003 someone please post the code for this.. i really need it so i can release the first version of my program. Quote
Administrators PlausiblyDamp Posted December 7, 2003 Administrators Posted December 7, 2003 picturebox1.Image=system.Drawing.Image.FromFile("path here") should do it I think. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
darknuke Posted December 21, 2003 Posted December 21, 2003 System.IO.Directory.GetCurrentDirectory :) Quote This is only a test of the emergency broadcast system This is a product of hysterical mass confusion A ship of fools adrift on the sea of our pollution Rudderless and powerless on the sea of our delusion pennywise - this is only a test
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.