Results 1 to 10 of 10

Thread: Load a html tag in vb6

  1. #1

    Thread Starter
    Hyperactive Member DarkX_Greece's Avatar
    Join Date
    Jan 2004
    Location
    Athens (Greece)
    Posts
    315

    Exclamation Load a html tag in vb6

    I am creating a custom web control and i need some help.
    Until now my control can understand the following tags:
    1) <html></html>
    2) <body></body>
    3) <font...></font>
    4) <li></li>
    5) <br>
    6) <left></left>
    7) <right></right>
    8) <center></center>
    9) <p></p>


    Now i need to add the following:
    1) <a....>...</a>
    2) <img ....>
    3) <s></s>
    4) <i></i>
    5) <u></u>
    6) <b></b>
    7) <title></title>
    9) <strong></strong>
    10) <strike></strike>


    Could u help me with one of them?
    I am using Rich Text Box to show the html page, so send me some source code applying on Rich Text Box.
    Short CV:
    1. Visual Basic 6 Programmer
    2. Web Expert


    Botonakis Web Services

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    if you made a custom control that can parse the top list of tags, how could you are asking for source code to impliment the bottom list of tags. They would be parsed and handled in the same way

  3. #3

    Thread Starter
    Hyperactive Member DarkX_Greece's Avatar
    Join Date
    Jan 2004
    Location
    Athens (Greece)
    Posts
    315

    Exclamation Are u serious?

    Are u serious about it?

    Have can u say about it, <a ...> </a> is not the same with <font ...> </font> tag so they need different VB Code. Also <a...</a> is about images and i don't know how to add formated images in Rich Text Box, but <font...</font is about fonts and it is more easier than the first one.
    The same is for the other tags.

    The next time u will send somthing like your first message, just think about it before write any ....WRONG thing.
    Short CV:
    1. Visual Basic 6 Programmer
    2. Web Expert


    Botonakis Web Services

  4. #4
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    my point is if you could write a control to parse the one list, you should have no trouble creating code to parse the second list.

    You didn't post code asking for help with a certain part, like how to display an image in the rich text box when parsing an image tag

    you simply just asked for source code, which tells me you didn't try, and are probably using someone elses code to start with...

    I help people that make an effort, not people that just want the code to call their own to stick in their app

    when you actually have some code to show, maybe someone here will help you

  5. #5
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Besides, DarkX_Greece, you aren't even asking for help you are simply asking some one to do all the work for you and provide the code. I think that is very rude.

  6. #6

    Thread Starter
    Hyperactive Member DarkX_Greece's Avatar
    Join Date
    Jan 2004
    Location
    Athens (Greece)
    Posts
    315

    Exclamation Ok, look at this

    First, i am not like some people who are using code from other, i try to make the cod myself , so don't tell again things like them.

    I don't have any problems sending my code but it is not ready yet.
    But because u send that , u think i am asking for your help only because i use others code then look at it:


    Rich Text Box's Name = Page
    Form's Name = Form1



    Function FormatFont()
    'Find the font tag
    Dim tFont As Integer
    tFont = InStr(tFont + 1, Form1.Page.Text, "<font ", vbTextCompare)
    While tFont > 0
    Dim eFont As Integer
    eFont = InStr(tFont + 1, Form1.Page.Text, "</font>", vbTextCompare)
    If (eFont > tFont) Then
    'find whats between these
    Dim hFindFont As String
    Dim hFontSize As Variant
    Dim hFontName As String
    Dim etFont As Integer
    etFont = InStr(tFont + 1, Form1.Page.Text, ">", vbBinaryCompare)
    If ((etFont > tFont) And (etFont < eFont)) Then
    'select what we want
    Form1.Page.SelStart = tFont + 5
    Form1.Page.SelLength = (etFont - 2) - (tFont + 5)
    hFindFont = Form1.Page.SelText
    hFontName = FindFontName(hFindFont)
    hFontSize = FindFontSize(hFindFont)
    Form1.Page.SelStart = etFont
    Form1.Page.SelLength = (eFont - 1) - (etFont)
    Form1.Page.SelFontName = hFontName
    Form1.Page.SelFontSize = hFontSize
    End If
    End If
    tFont = InStr(tFont + 1, Form1.Page.Text, "<font ")
    Wend
    End Function



    Function FindFontName(line As String)
    Dim name As Integer
    Dim space As Integer
    name = InStr(name + 1, line, "name=", vbTextCompare)
    If (name > 0) Then
    space = InStr(name + 1, line, "", vbTextCompare)
    If (space > name) Then
    Dim L1 As Integer
    L1 = Len(Mid(line, name + 6))
    FindFontName = Mid(line, name + 6, L1)
    Else
    FindFontName = Mid(line, name + 6, Len(line))
    End If
    End If
    End Function



    Function FindFontSize(line As String)
    Dim size As Integer
    Dim space As Integer
    size = InStr(size + 1, line, "size=", vbTextCompare)
    If (size > 0) Then
    space = InStr(size + 1, line, " ", vbTextCompare)
    If (space > size) Then
    FindFontSize = Mid(line, size + 5, (space) - (size + 5))
    Else
    FindFontSize = Mid(line, size + 5, Len(line))
    End If
    End If
    End Function



    This is the code for <font> </font> tag. <a> </a> and <img src...> are very similar to font tag but i can't make the code because i have some problems:
    1) I can't create hyperlinks in Rich Text Box , using SelRTF
    2) I can't format the images in the Rich Text Box.(someone told me that it is impossible, but i know that is wrong.)


    Now, if anyone want to help me for my project then send something, even an example , i don't want only code.
    Short CV:
    1. Visual Basic 6 Programmer
    2. Web Expert


    Botonakis Web Services

  7. #7
    Frenzied Member vbNeo's Avatar
    Join Date
    May 2002
    Location
    Jutland, Denmark
    Posts
    1,994

    Re: Are u serious?

    Originally posted by DarkX_Greece
    Are u serious about it?

    Have can u say about it, <a ...> </a> is not the same with <font ...> </font> tag so they need different VB Code. Also <a...</a> is about images and i don't know how to add formated images in Rich Text Box, but <font...</font is about fonts and it is more easier than the first one.
    The same is for the other tags.

    The next time u will send somthing like your first message, just think about it before write any ....WRONG thing.
    <a> is an anchor and has nothing to do with images
    "Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
    - Zack de la Rocha


    Hear me roar.

  8. #8

    Thread Starter
    Hyperactive Member DarkX_Greece's Avatar
    Join Date
    Jan 2004
    Location
    Athens (Greece)
    Posts
    315

    Exclamation I know it

    Yes i know it!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


    <a> tag is for urls.
    <img> tag is for images.

    That was only an example.



    Ôé íá óáò ðù ñå ðáéäéÜ, åäþ üëïé åßóôå ôñåëïß , ôåëéêÜ åäþ äå âïçèÜôå êáèüëïõ, ôï ìüíï ðïõ êÜíåôå åßíáé êñéôéêÞ! Áí äåí ìðïñåßôå íá áðáíôÞóåôå óå Ýíá ìíì , áðëÜ ìçí áðáíôÜôå , äåí ÷ñåéÜæåôáé íá óôÝëíåôå âëáêåßåò.

    Êþóôáò ÌðïôïíÜêçò.

    Kostas Botonakis
    Short CV:
    1. Visual Basic 6 Programmer
    2. Web Expert


    Botonakis Web Services

  9. #9
    Frenzied Member vbNeo's Avatar
    Join Date
    May 2002
    Location
    Jutland, Denmark
    Posts
    1,994
    I'd suggest you make a general parser for all tags, scanning for all attributes meaning anything for your app...

    Cheers!
    "Lies, sanctions, and cruise missiles have never created a free and just society. Only everyday people can do that."
    - Zack de la Rocha


    Hear me roar.

  10. #10

    Thread Starter
    Hyperactive Member DarkX_Greece's Avatar
    Join Date
    Jan 2004
    Location
    Athens (Greece)
    Posts
    315

    Exclamation General Parser?

    Ok , your idea is good but how. All the tags are very different from themselves. Please if you know a way for me to do it, just give me an example code to move on!


    Thanks for sending me something important , not like the others!
    Short CV:
    1. Visual Basic 6 Programmer
    2. Web Expert


    Botonakis Web Services

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width