Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 7th, 2004, 07:30 AM
Authorized User
 
Join Date: Jun 2003
Location: , , .
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?
Reply With Quote
  #2 (permalink)  
Old April 7th, 2004, 08:28 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
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.
Reply With Quote
  #3 (permalink)  
Old April 7th, 2004, 08:33 AM
Friend of Wrox
 
Join Date: Nov 2003
Location: , , .
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---
----------

<><
Reply With Quote
  #4 (permalink)  
Old April 8th, 2004, 02:43 AM
Authorized User
 
Join Date: Jun 2003
Location: , , .
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 :(
Reply With Quote
  #5 (permalink)  
Old April 8th, 2004, 09:20 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

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

J
Reply With Quote
  #6 (permalink)  
Old April 9th, 2004, 07:53 AM
Authorized User
 
Join Date: Jun 2003
Location: , , .
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?
Reply With Quote
  #7 (permalink)  
Old April 9th, 2004, 08:13 AM
Authorized User
 
Join Date: Jun 2003
Location: , , .
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Disregard, I found a webbrowser control to use.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 07:38 AM.


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