Results 1 to 4 of 4

Thread: [RESOLVED] What CTRL in .NET can display B-Code without parsing?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2019
    Location
    Sabattus
    Posts
    234

    Resolved [RESOLVED] What CTRL in .NET can display B-Code without parsing?

    What CTRL in .NET can display B-Code without parsing?

    I have a DB that uses <p>, <b>, <i> (and their closing tags)

    Thanks
    Can't Type - Forgetful - Had Stroke = Forgive this old man!
    Website: https://pixelinkmedia.wixsite.com/frankhilton
    VSCOMM 2022 • LAZARUS 2.2.0 • Win10 • 16G RAM • Nvida GForce RTX 2060

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Apr 2019
    Location
    Sabattus
    Posts
    234

    Re: What CTRL in .NET can display B-Code without parsing?

    I discovered that the web browser can.
    Can't Type - Forgetful - Had Stroke = Forgive this old man!
    Website: https://pixelinkmedia.wixsite.com/frankhilton
    VSCOMM 2022 • LAZARUS 2.2.0 • Win10 • 16G RAM • Nvida GForce RTX 2060

  3. #3
    Lively Member
    Join Date
    Jan 2020
    Posts
    120

    Re: [RESOLVED] What CTRL in .NET can display B-Code without parsing?

    You could add a reference to Microsoft Script Control Library (COM) and use code like this to evaluate an expression. (Also works for JScript.)

    HTML Code:
    Dim sc As New MSScriptControl.ScriptControl()
    sc.Language = "VBScript"
    Dim expression As String = "1 + 2 * 7"
    Dim result As Double = sc.Eval(expression)
    Edit - C# version.

    Code:
    MSScriptControl.ScriptControl sc = new MSScriptControl.ScriptControl();
    sc.Language = "VBScript";
    string expression = "1 + 2 * 7";
    object result = sc.Eval(expression);            
    MessageBox.Show(result.ToString());

  4. #4
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,532

    Re: [RESOLVED] What CTRL in .NET can display B-Code without parsing?

    Quote Originally Posted by pixelink View Post
    What CTRL in .NET can display B-Code without parsing?

    I have a DB that uses <p>, <b>, <i> (and their closing tags)

    Thanks
    What's "B-Code"?
    What you're asking about is HTML...

    Quote Originally Posted by pixelink View Post
    I discovered that the web browser can.
    Keep in mind that the web browser in VB uses the IE7 engine... if you want to use newer functionality, you'll need to flip a registry setting. Search the forums for "VB web browser compatibility registry setting" that should bring up the relevant posts.

    Quote Originally Posted by Prahlad View Post
    You could add a reference to Microsoft Script Control Library (COM) and use code like this to evaluate an expression. (Also works for JScript.)

    HTML Code:
    Dim sc As New MSScriptControl.ScriptControl()
    sc.Language = "VBScript"
    Dim expression As String = "1 + 2 * 7"
    Dim result As Double = sc.Eval(expression)
    Edit - C# version.

    Code:
    MSScriptControl.ScriptControl sc = new MSScriptControl.ScriptControl();
    sc.Language = "VBScript";
    string expression = "1 + 2 * 7";
    object result = sc.Eval(expression);            
    MessageBox.Show(result.ToString());
    And what does that have to do with anything in this thread? that's for running VBScript... not rendering HTML which is what the OP was asking about.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

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