Wrox Programmer Forums
|
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 7th, 2004, 07:30 AM
Authorized User
 
Join Date: Jun 2003
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default Create HTML

I currently generate statistical information and display it in labels and textboxes on a windows form. Instead of displaying it on a form I want to programattically generate HTML and then spawn a browser to display it.

Does anyone have any ideas on how to generate HTML programatically?
 
Old April 7th, 2004, 08:28 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Sounds like what you need to do is generate the HTML...

sHtml = "<html>........</html>"

then save the generated string to a file. I'm not sure how you launch the file to a browser, perhaps someone else can pick this up.
 
Old April 7th, 2004, 08:33 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Something like this (forgive me if I'm off, I know little about VB.NET):

Code:
ShellExecute(Me.Handle.ToInt32, "open", "c:\DocumentPreview.htm", vbNullString, vbNullString, SW_SHOW)
----------
---Snib---
----------

<><
 
Old April 8th, 2004, 02:43 AM
Authorized User
 
Join Date: Jun 2003
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Actually, to invoke a browser use the following:

    System.Diagnostics.Process.Start(URL as string)

Planoie,

I tried simply generating a large text string but got a bunch of errors because inside the HTML there are quotations that mess up the declraration of a text string :(
 
Old April 8th, 2004, 09:20 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Replace the single quotes in your text string with double quotes.

J
 
Old April 9th, 2004, 07:53 AM
Authorized User
 
Join Date: Jun 2003
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks!

Next question.

Does anyone know how I can embed a browser into my windows form? Instead of spawning a new browser instance, I would rather display the HTML page in my windows form. Any ideas or links to sample code?
 
Old April 9th, 2004, 08:13 AM
Authorized User
 
Join Date: Jun 2003
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Disregard, I found a webbrowser control to use.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Create ScrollBar for HTML DIV Adawi VB How-To 3 March 26th, 2008 10:05 AM
Can't create html page from template thiwan Dreamweaver (all versions) 4 June 13th, 2005 11:53 AM
Using xsl to create HTML combo boxes rdavisiii XSLT 4 November 23rd, 2004 05:40 AM
create pasword in html pheak ASP.NET 1.0 and 1.1 Basics 2 May 31st, 2004 09:33 AM
How to create a string from XML Island in HTML? chandima Javascript How-To 2 October 10th, 2003 02:08 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.