Tech Support Guy banner
Status
Not open for further replies.
1 - 7 of 7 Posts

·
Registered
Joined
·
88 Posts
Discussion Starter · #1 ·
Hey guys,

Sorry but I have very little experience in developing but here it goes.

I have an existing program and I have been tasked with adding a help section via HTML. I have the HTML help working but I wanted to try and integrate it in the app instead of opening IE. I'm stuck and clueless :confused:

Here is what I have so far (pretty much nothing) but I want to point the WPF control WebBrowser to a specific location and index.html file "\\mysrv\help\index.html"

Code:
<Page x:Class="AppName.PageHelp"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      ShowsNavigationUI="False"
      mc:Ignorable="d" 
      d:DesignHeight="768" d:DesignWidth="1024"
      Title="Help">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <ScrollViewer Grid.Row="0" Margin="0">
            <WebBrowser Height="768" Width="1024"/>
        </ScrollViewer>
    </Grid>
</Page>
Like I said I'm clueless and I'm not married to what I have above so if there is a better control to use or way to do it I'm down for it.

Also separately it would be cool if the user can have this browser up and still have the ability to use the main app without having to close the help window first
 

·
Registered
Joined
·
88 Posts
Discussion Starter · #4 ·
Yeah sorry I guess that would be the correct thing to do on here; just figured that since no one viewed or replied, my question was silly or didn't make sense. I couldn't figure out how to delete my thread.

But here it is.

This is the XAML code for the page with the WebBrowser function in it.

Code:
<Page x:Class="PageHelp"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      ShowsNavigationUI="False"
      mc:Ignorable="d"
      d:DesignHeight="768" d:DesignWidth="1024"
      Title="Help"
      Loaded="Window_Loaded">
    <WebBrowser Name="HelpPage"></WebBrowser>
</Page>
Then after that was setup I had to code the PageHelp.xaml.cs; this is how I coded it and it works great.

Code:
namespace appname
{
    /// <summary>
    /// Interaction logic for PageHelp.xaml
    /// </summary>
    public partial class PageHelp : Page
    {
        public PageHelp()
        {
            InitializeComponent();
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            //Loads compiled HTML help page.
            this.HelpPage.Navigate("file://///FileSrv/Path/to/HTML/index.html");
        }
    }
}
This was allowed me to point the WebBrowser control to an existing HTML help style web page where you can search and browse through help topics.

Attached is a screen shot of the finished product.

The content was created from a Microsoft Word Document then we used or rather testing and may possibly use http://www.helpandmanual.com/products_hm_overview.html to compile the HTML version of our help document.

I chose this route rather than CHM style help because I think it looks a lot better.

Next I am going to try to figure out how to make context based help where it will launch this browser and go to a specific topic via some type of image type button next to specific areas with in the App that the user may need help with instead of opening help separately and searching for their specific feature they are trying to use.

I'm sure this is child's play for most of you guys but not touching any coding or development for almost 17 years (VB6) I was over my head and completely clueless....

Hope this info helps someone like me in the future!
 

Attachments

·
Registered
Joined
·
88 Posts
Discussion Starter · #5 ·
Ok so I have another issue that I could use someones help with. Again I know this most likely will be a silly question.

The way this help page opens is via a menu item labeled "help". When the use clicks on that help page comes up with the WebBrowser control pointing to my HTML help. The problem is I have to close that page before I can use the main app again. I can see for most people they want to see their help and read through it as they use the main app. The way it is setup currently I cannot do that. How do can I make this help page appear when requested but still allow the user to use the main app?
 

·
Registered
Joined
·
88 Posts
Discussion Starter · #6 ·
Ok figured this out too. Just so this may help someone in the future.

The code that was opening the Help page (WebBrowser control) had .ShowDialog();

I just changed it to just .Show();

That let me open the new window independent of the MainWindow so the user can switch focus from the Main to Help pages.
 

·
Registered
Joined
·
4,400 Posts
Ok figured this out too. Just so this may help someone in the future.

The code that was opening the Help page (WebBrowser control) had .ShowDialog();

I just changed it to just .Show();

That let me open the new window independent of the MainWindow so the user can switch focus from the Main to Help pages.
Sorry, I was in the middle of a reply to help with the second one yesterday and got pulled away. Glad you got it going.
 
1 - 7 of 7 Posts
Status
Not open for further replies.
Top