Results 1 to 14 of 14

Thread: Run html code in vb without controls.

  1. #1

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

    Exclamation Run html code in vb without controls.

    Is anyone know anything about MOSAIC.
    Mosaic is a project o an US university. Mosaic is the main source of Internet Explorer(see About box).

    Web Control uses it to catch html code.

    Do you know how to do it by code?
    Just anything, <title> </title> , <div> </div> , <script> </script> etc...............


    Please help me.
    Short CV:
    1. Visual Basic 6 Programmer
    2. Web Expert


    Botonakis Web Services

  2. #2
    Frenzied Member dynamic_sysop's Avatar
    Join Date
    Jun 2003
    Location
    Ashby, Leicestershire.
    Posts
    1,142
    well here's a link to MOSAIC's download page, not sure if you can run the stuff in vb , but i'll soon find out
    MOSAIC
    ~
    if a post is resolved, please mark it as [Resolved]
    protected string get_Signature(){return Censored;}
    [vbcode][php] please use code tags when posting any code [/php][/vbcode]

  3. #3

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

    Exclamation I know that...

    dynamic_sysop , the url you game me, i've visited 3 times before.From there you can download Mosaic 3.0 standalone version, not source code.

    I need a example that it will look like mosaic's and Internet Explore's code.

    My current project is a custom Browser Control, so I need a code like Mosaic, without using third dll's or some activex.

    I you help me i will give you my current project for free as i've done it already to an other user.

    Send your reply soon, telling me more about this.

    Thank you for answering my thread.

    Kostas Botonakis , Greece



    (nice twins, yours?) I'm too young for making my family, if are yours you should be very happy about them.


    Sorry for my bad english, I'm Greek.
    Short CV:
    1. Visual Basic 6 Programmer
    2. Web Expert


    Botonakis Web Services

  4. #4
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246
    Hehe, you are very brave to try and make your own Web Browser Control. I have tried (using a picturebox as a base) and have been so close! Formatting text was the hardest part

    Something like this?:

    VB Code:
    1. Dim TagCount() As String
    2. Dim num_tags As Integer
    3.  
    4. Dim op As Integer   'holds the <
    5. Dim cl As Integer     'holds the >
    6.  
    7.  
    8. 'remove new lines..
    9. Function RemoveNewLines(txt As TextBox)
    10. Dim pos As Integer
    11.  
    12. pos = InStr(pos + 1, txt.Text, vbNewLine, vbBinaryCompare)
    13.  
    14. While (pos > 0)
    15. txt.selstart = pos - 1
    16. txt.sellength = Len(vbNewLine)
    17. txt.seltext = ""
    18.  
    19. pos = InStr(pos + 1, txt.Text, vbNewLine)
    20. Wend
    21. End Function
    22.  
    23.  
    24. Function ParseHTML(txt As TextBox)
    25. 'find the opening <
    26. op = InStr(op + 1, txt.Text, "<", vbBinaryCompare)
    27. While (op > 0)
    28.     'we have found it!
    29.     cl = InStr(op + 1, txt.Text, ">", vbBinaryCompare)
    30.     If (cl > op) Then
    31.         'we have a tag!
    32.         ReDim TagCount(num_tags)
    33.         txt.SelStart = op
    34.         txt.SelLength = (cl - 1) - (op)
    35.         'store the tag in TagCount()
    36.         TagCount(num_tags) = txt.SelText
    37.         num_tags = num_tags + 1
    38.     End If
    39.     '/* redo */
    40.     op = InStr(op + 1, txt.Text, "<")
    41. Wend
    42. End Function

    Using something like that, I am sure you will be able to figure the rest out.


    Hope this helps...



    Phreak
    End Function

    Visual Studio 6, Visual Studio.NET 2005, MASM

  5. #5

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

    Exclamation Run html code in vb without controls

    Not so brave, just have the "balls" to create a war to OTHER famous web controls.

    Thanks for the code, if you have more send them to me.


    When i complete the project i will send it here, just remember to download it for your modifiactions.

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


    Botonakis Web Services

  6. #6

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

    Exclamation Error!!!

    Phreak, your code is not totally worked.


    Function RemoveNewLines(txt As TextBox) worked great
    Function ParseHTML(txt as Textbox) didn't work.


    I've seen some ParseHTML source codes before and worked, yours is not working.(not finding and removing tags from text)

    I can't find what is the problem but if you can fix it, then do it soon because i need it for making some modifications in the custom browser control functions and features.

    Now i am working in browser's history.(back , next , startup page etc).That's registry stuff but some are not so easy as they look.

    VERY IMPORTANT:
    If you want to take part in my project then send some informations about you and some usefull code for the project.


    Also for news:
    Did you hear about the new open source WINDOWS?
    They look like Microsoft Windows ME, they are free and only 5MB!!!

    Download it for free or midify it: http://www.reactos.com/
    Send me your replies!





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


    Botonakis Web Services

  7. #7
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246
    OH!


    You are not wanting to format the text yourself? You just want to remove the tags from the source?


    Simple simple simple:

    VB Code:
    1. Function RemoveTags(txt As TextBox)
    2. 'just need to add more tags
    3.  
    4. Dim pos As Integer
    5. pos = InStr(pos + 1, txt.Text, "<html>", vbTextCompare)
    6.  
    7. While (pos > 0)
    8.     'delete it
    9.     txt.SelStart = pos - 1
    10.     txt.SelLength = Len("<html>")
    11.     txt.SelText = ""
    12.  
    13.     pos = InStr(pos + 1, txt.Text, "<html>")
    14. Wend
    15. End Function

    This removes all instances of the <html> tag, no matter if its in upper or lower case.

    I would like to participate in such a control, however, I think I deleted what I had of my one

    Phreak

    Visual Studio 6, Visual Studio.NET 2005, MASM

  8. #8

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

    Exclamation That's OK

    That's OK.

    Do you know how to make paragraphs if you have a simple text box , not a rich text box?

    Or paragraphs with a label!!!
    Label is placed in a picture box and is modified like a text box. Is textbox replacement.

    I need a code to make paragraphs in simple text boxes and in labels. It is not so simple like other but i know that it is possible.


    My email [email protected] so if you want contact me , more private than here.


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


    Botonakis Web Services

  9. #9
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246
    Do you mean, centering the text and not being able to backspace past a certain point? Or this:

    VB Code:
    1. Private Sub TextBox_KeyDown(KeyCode As Integer, Shift As Integer)
    2. TextBox.SelText = vbTab
    3. End Sub


    Phreak

    Visual Studio 6, Visual Studio.NET 2005, MASM

  10. #10

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

    Exclamation Not like that

    MMM, not like that...

    Centering text , not one line, but two , three , four...that depends on <div> tag.

    And sth important! Not centering all the text in text box, but just the text inside the tag <div>.......</div>

    That's why it is difficult.

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


    Botonakis Web Services

  11. #11
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246
    Guess what I found


    My attempt at something like this. It isn't very well done. I never used to indent my code either. But take a look:


    Phreak
    Attached Files Attached Files

    Visual Studio 6, Visual Studio.NET 2005, MASM

  12. #12

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

    Thumbs down No no no

    That's not i thought about.

    Browser control needs a code to do the following....

    If you have an html page with some lines of code,
    the browser control should do:
    1) find the title (done)
    2) split the <html> code from the <body> code (done)
    3) Load colors, for text and background (done)
    4) Find the paragraphs and text formatting (NOT DONE YET)
    5) Load background images (Done)
    6) Load other images , like gifs , jpg , bmp , png (NOT DONE YET)
    7) Load scripts , VBScripts, JScripts (NOT DONE YET)
    8) Password protections feature (Done)
    9) Right Click menu and custom right click menu. (Done)

    If you know something from the them above then send something soon.
    I would prefer source code, not projects, or urls.




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


    Botonakis Web Services

  13. #13
    G&G Moderator chemicalNova's Avatar
    Join Date
    Jun 2002
    Location
    Victoria, Australia
    Posts
    4,246
    For the scripts, you can use the Microsoft Script Control. These will execute the script onto any object you add:

    [Highlight=VB]

    ScriptControl1.AddObject Picture1, "document"

    [Highlight=VB]

    Then you could have a script:

    Code:
    <script>
    document.BackColor = RGB(255,255,0)
    </script>
    As for the rest of them, they might take me a while to do (properly).

    You have MSN?

    if so, PM me your msn, and we can go into more detail, instead of cluttering up the forums.



    Phreak

    Visual Studio 6, Visual Studio.NET 2005, MASM

  14. #14

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

    Exclamation Ok

    The code is ok but ias i said i don't want to use third controls, like Microsoft's script control,only the basic controls(textbox,command button etc)


    Look, i don't have msn , but i will today.
    I have already NET Passport so its fast.

    Send me your msn name at my email adress:
    [email protected]


    Kostas Botonakis, Greece
    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