<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="robots" content="noindex, nofollow">
<title>Blog menu example - Bootsnipp.com</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet" id="bootstrap-css">
<style type="text/css">
body{padding:20px;} </style>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<script type="text/javascript">
window.alert = function(){};
var defaultCSS = document.getElementById('bootstrap-css');
function changeCSS(css){
if(css) $('head > link').filter(':first').replaceWith('<link rel="stylesheet" href="'+ css +'" type="text/css" />');
else $('head > link').filter(':first').replaceWith(defaultCSS);
}
$( document ).ready(function() {
var iframe_height = parseInt($('html').height());
window.parent.postMessage( iframe_height, 'https://bootsnipp.com');
});
</script>
</head>
<body>
<div class="sidebar-nav">
<div class="well" style="width:300px; padding: 8px 0;">
<ul class="nav nav-list">
<li class="nav-header">Main</li>
<li class="active"><a href="index"><i class="icon-home"></i> Dashboard</a></li>
<li><a href="#"><i class="icon-edit"></i> Add Blog Post</a></li>
<li><a href="#"><i class="icon-calendar"></i> Calendar</a></li>
<li><a href="#"><i class="icon-user"></i> Members</a></li>
<li><a href="#"><i class="icon-comment"></i> Comments</a></li>
<li><a href="javascript:ajaxRequest(MainForm.window,'openform',[]);"><i class="icon-picture"></i> Gallery</a></li>
</ul>
</div>
</div>
<script type="text/javascript">
</script>
</body>
</html>
1.UniHTMLFrame1 控件写入上面代码,也可以其他bootstrap或网页代码;
2.添加下面的方法
procedure TMainForm.UniFormAjaxEvent(Sender: TComponent; EventName: string;
Params: TUniStrings);
var
s:string;
freeform:TUniForm1;
begin
if EventName = 'openform' then
begin
freeform:=TUniForm1.Create(UniApplication);
freeform.Caption:='1';
freeform.ShowModal;
end;
end;