Library tutorials & articles
Creating HTML Help
Using stylesheets
Programmers who already know HTML, and use style sheets can skip this section, as it is exactly the same.
In order to ensure that all your documents are of the same style (ie all the headers are the same size and colour), you can use stylesheets. First, you need to create a stylesheet:
1) Open Notepad, and enter the text below
h1 {color:blue;font-size: 12pt;}
p {font-family: 'Tahoma';font-size: 10pt;}
2) Save the file as default.css in your html directory.
Then, enter the following html into all of your html pages. This will link the html document to the stylesheet. It is therefore a good idea to do this before you have written them all!
<link rel="STYLESHEET" HREF="default.css" TYPE="text/css">
Now, you can have a play around with the stylesheet text. First, lets look at the text we have already entered:
; the first bit: 'h1 {' means that the braces {} contain style information
for all text contained in h1 tags.
; the second bit: 'color:blue;' sets the colour of h1 tags to blue
; the third bit: 'font-size: 12pt' sets the font size to 12pts
h1 {color:blue;font-size: 12pt;}
So, what's these h1 tags then, I here you ask. Well, instead of surrounding your text by p (p for paragraph) tags, like this:
<p>Hello!</p>
you use h1 tags, like this:
<h1>Hello!</h1>
It's as simple as that! In a stylesheet, you can also specify styles for:
| Tag | Description |
| h1 | Header 1 |
| h2 | Header 2 |
| h3......h6 | and all headers to Header 6 |
| p | Paragraph text (the main body of your text) |
| a | Hyperlinks |
Each
And, inside the braces, you can use the following styles:
| Style 'descriptors' | Description |
| color | Font Color |
| font-face | Font Name (you need to contain these with a '
each side: font-face:'Tahoma'; |
| font-size | font size. Put a pt after the value: font-size: 10pt; |
| text-decoration | Set to text-decoration: none; for no underline, and text-decoration: underline; for underlined text |
| font-weight | Set to font-weight: normal; for regular, and font-weight: bold; for bold text |
For more information, click Help Topics on the Help menu, and enter Cascading Style Sheets, and click HTML Tag Reference, and open the CSS book in the contents pane.
Any queries, or if you have a better way to describe this, please contact me.
Related articles
Related discussion
-
VB6, SQL 2005 & DMO
by elajaunie3 (1 replies)
-
sending sms from pc
by sriraj20074 (0 replies)
-
Automating Excel from VB6.0
by epurdy (0 replies)
-
VB6 system conversion using VBA to Word 2007
by b.macgregor@vodamail.co.za (0 replies)
-
video not working with visual basic
by Jupiter 2 (9 replies)
Related podcasts
-
Christian Beauclair
14 mai 2008 (�mission #0074) ::.Christian Beauclair: Stratégies de migration VB6 vers .NET Nous discutons avec Christian Beauclair des stratégies de migration VB6 vers .NET. Entre autres, nous discutons comment utiliser le "VB 6 Code Advisor" et le "Interop Forms Toolkit" pour ajouter la puiss...
hi,
i sent u how retrive the file
if you want how to create and the rest of the process, pls give some time
bye
HI, i found this is the one of of the way we can creat and its very simple;
System.Diagnostics.Process process = new System.Diagnostics.Process();process.StartInfo.FileName = System.AppDomain.CurrentDomain.BaseDirectory + "Urfile.chm";process.Start();
This will work definitely.
BYE
Hi. I went through your tutorial on creating HTML Help, but keep running into a very basic problem. After compiling the help file for the first time and opening up the chm file, my home.htm file does not display at all in the right window. I get the help file window (with the HIDE, BACK, FORWARD, etc. displayed, but the window on the right is blank. I followed your tutorial step by step, saved the html files in the directories as indicated, etc. What am I doing wrong? I receive no error messages or security warnings. Thanks in advance!
Can you give me any detail or any url where I can find about how to create chm files programmatically using C#??
Thanks in Advance
Nilesh Gambhava
i have tried to make popup in html help but coudn't. can somebody help.
I have kinda the same problem. Showing a topic works for me if the pages are within the chm file, however, if a topic is on a web site,
even though I can retrieve them by ciking on them, with the HtmlHelp function, both using HHDISPLAYTOPIC and HHHELPCONTEXT..
the help viewer jumps to the topic, but fails retrieving the page on the content pane. It does seem to synchronize, it doesn shange the content pane, but to a bad page, like it wants it to be within it.. or I don't really know. So please please, someone help me! you know what to do? have seen this?
Hi, I read your entire article and it really helped a lot but I can't wrap up what I've made because for some reason the help file just won't show.
Private Sub mnuHelpHowto_Click()
HTMLShowTopic 1030
End Sub
...
Public Sub HTMLShowTopic(lngTopicID As Long)
' Force the Help window to load a specific topic.
' The Help window will synchronize the
' Contents display automatically
htmlhelp hwnd, App.helpfile & ">Main", HHDISPLAYTOPIC, lngTopicID
End Sub
I don't quite understand why it will not show the help file, my comp appears to be processing something but in the end it does not show the help file. If I specify 0 as the lngTopicID it does show the window but at the default topic, not the topic I want it to show. FYI I have mapped the numbers to a file using the notepad trick.
Great I can use this now I understand it!
Well Done!
I followed the article and it fixed many of my problems but ...
I'm having problems displaying popup text with textboxes.
'No help ID matches control ID #...
Iv'e tested the popup text files outside the app and they're find. My code works with command buttons (only?).
Any ideas??
Excellent topic! this is very helpful, thanks a lot. It has been a great jumpstart for integrating html help file in VB. Hope you can include topics on popups.
Yes i do still have this problem.
Thankyou for your responce, unfortunatly i still cannot resolve my problem.
I have looked through some of the links you posted and i will look at the others in more detail when i have more time.
Thanks again.
Stevesoft,
In the unlikely event that you're still struggling with this problem...
> I have followed this tutorial and have the following problem:
>
> The code for displaying the contents or the index only works after i
> have pressed F1 to display help.
>
> Once i have done this once, the code works fine...... why is this?
The following are the principal documents on connecting HTML Help to an application. Maybe these will help.
http://www.smountain.com/mProgrammingHelp.htm (VB, C++)
http://www.mvps.org/htmlhelpcenter/mapping.htm
http://www.mvps.org/htmlhelpcenter/whcomplete.htm (VB)
http://www.workwrite.com/helpthink/vbliske.htm (VB)
http://helpware.net/delphi/index.html (Delphi)
http://www.workwrite.com/helpthink/delphi_chandler.htm (Delphi)
Pete
rollershade,
Just came across your message. Here's a very belated follow-up, in the unlikely event you still need this information.
> the ordinal 373 could not be located in the dynamic link library HHA.dll
Make sure that all the HTML Help runtime DLLs are properly installed and registered, using either:
HTML Help DLL Registrar (http://www.helpfulsolutions.com/)
MJ's Help Diagnostics (http://helpware.net/downloads/index.htm)
> the link u gave for the microsoft page cant be found
This was changed a little while ago to http://msdn.microsoft.com/library/en-us/htmlhelp/html/vsconHH1Start.asp.
Pete
i have installed it from the vb6 cd , but i try and run the html workshop, and i get this error
the ordinal 373 could not be located in the dynamic link library HHA.dll
any ideas, and the link u gave for the microsoft page cant be found
The code for displaying the contents or the index only works after i have pressed F1 to display help.
Once i have done this once, the code works fine...... why is this?
Stevesoft
This thread is for discussions of Creating HTML Help.