Click here to Skip to main content
13,292,997 members (99,860 online)
Click here to Skip to main content
Add your own
alternative version


16 bookmarked
Posted 21 Aug 2006

WebPage as MDI Background In TangramLite

, 21 Aug 2006
Rate this:
Please Sign up or sign in to vote.
WebPage as MDI Background and Interact with User

HTML Background:

Click "Create New Document" Button:

Navigate to some URL:

New Document:


Generally, there is a bitmap of company Logo as the background of MDI window. Sometimes, you may need a dynamic picture or more interactive ability. Here I will tell you how do it using TangranLite framework.

Config Background for MDI

You may download TangramLite first. After you setup, you can see "OS:\Program Files\TangramLite\debug" directory on your disk. There are samples we prepare for you.

Open "TangramLiteD.exe.config" file. This the config file for "TangramLiteD.exe", actually, this is XML format. You may see two nodes:


The first node specifies what type of background, here we want HTML. The second node specifies the filename of the HTML. But where is it located? You can find it here:

"OS:\Program Files\TangramUniverseDocument\Tangram Team\TangramLite\Background"

Now you can change it with your HTML page.

Interact with HTML

How can we interact with HTML? When we create a CHTMLView and navigate to a special HTML file, the webbrowser gets IDispatch interface of a COM object. Then we can write a script to invoke methods of the object through IDispatch. COM object's method can call native code. Open "C:\Program Files\TangramUniverseDocument\Tangram Team\TangramLite\Background\Background.htm" in Notepad or other editor to see source. We can find the script:

Sub Button1_onclick
End Sub

Sub Button2_onclick
End Sub

That means when you click Button1, it will invoke "NewDocument" method of theCOM object. We do an action in the method in fact. Open sample project "TangramLiteMainFrameD", there, you can find an interface "IApplication", it has a method "TangramLiteMainFrameD". We do NewDocument in the method implementation.


  • 21st August, 2006: Initial post


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Web Developer
China China
I've been programming since I was 21. Started with C++, looked at Java, keen on Visual Basic and Visual C++, thinking about .NET and C#.^_^.

You may also be interested in...

Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.171207.1 | Last Updated 21 Aug 2006
Article Copyright 2006 by wlwlxj
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid