不想让主窗体出现滚动条? 怎么办?
我把窗体属性的AutoScroll设置为false..但是还是出现...郁闷 呢
我把窗体属性的AutoScroll设置为false..但是还是出现...郁闷 呢
解决方案 »
- 如何解析此xml??????
- 如何用select語句得到一個我想要的虛擬字段,要可以修改的。(如虛擬:test int)?
- 请教:安装控件后提示的错误
- 如何取得申请进入局域网的机器的IP和机器名、密码
- 我想再做一个代码表,然后在计算表的现价格中选1-3
- 关于屏保程序的讨论
- 请高手帮忙将下面C语言转换成Delphi语言,高分奉献!!!
- 急!!!怎样让回车键代替Tab键的功能。谢谢!
- 要ADOQUERY当前记录指针位置发生改变时引发的是哪个事件?
- ***********delphi与asm的基本问题.***************
- 动态创建的菜单项,如果几个菜单项共用一个onClick过程,如何判断当前点击的是哪一个项? 如何获取其索引值?
- 动态数组不能与字符串相互赋值
Tfrm_Product *PrdChild;
PrdChild = new Tfrm_Product(Application);
PrdChild->Height = this->ClientHeight * 0.80;
PrdChild->Width = this->ClientWidth *85;我拖动子窗体就会出现滚动条...
我想子窗体刚好占满主窗体的客户区....不知怎么控制好...还有就是怎么拖动子窗体也不要出现滚动条
#include <vcl.h>
#pragma hdrstop#include "Main.h"
#include "About.h"
//---------------------------------------------------------------------------
#pragma resource "*.dfm"
TMainForm *MainForm;//MDI主窗口变量
//---------------------------------------------------------------------------
int i_ChildWidth=0;//添加两个全局变量,初始值为0
int i_ChildHeight=0;
2.修改你的上面的代码,添加个if语句
Tfrm_Product *PrdChild;
PrdChild = new Tfrm_Product(Application);
PrdChild->Height = this->ClientHeight * 0.80;
PrdChild->Width = this->ClientWidth *85; //添加下面这个if语句
if (i_ChildWidth == 0)
{
Tile();
i_ChildWidth = Child->Width;
i_ChildHeight = Child->Height;
}
else
{
Child->Height = i_ChildHeight;
Child->Width =i_ChildWidth;
}搞定~~~
PrdChild = new Tfrm_Product(Application);
PrdChild->Height = this->ClientHeight * 0.80;
PrdChild->Width = this->ClientWidth *85;//添加下面这个if语句
if (i_ChildWidth == 0)
{
Tile();
i_ChildWidth = PrdChild->Width;
i_ChildHeight = PrdChild->Height;
}
else
{
PrdChild->Height = i_ChildHeight;
PrdChild->Width =i_ChildWidth;
}
//父窗体
//Unit1.h
class TForm1 : public TForm
{
__published: // IDE-managed Components
private: // User declarations
public: // User declarations
__fastcall TForm1(TComponent* Owner);
void __fastcall ClientWndProc(TMessage& Message); //++
TFarProc NewClientWndProc; //++
TFarProc OriginalClientWndProc; //++
};//父窗体
//Unit1.cpp
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
NewClientWndProc = 0;
OriginalClientWndProc = 0;
NewClientWndProc = MakeObjectInstance(ClientWndProc);
OriginalClientWndProc=reinterpret_cast<void*>(SetWindowLong(ClientHandle,GWL_WNDPROC,reinterpret_cast<LONG>(NewClientWndProc)));
}
//---------------------------------------------------------------------------
void __fastcall TForm1::ClientWndProc(TMessage& Message)
{
//-------------------------------//
// Perform Message Handling Here //
//-------------------------------//
//不显示滚动条
ShowScrollBar(ClientHandle,SB_BOTH,false);
// Then call the original WndProc() for the other messages
if(OriginalClientWndProc != 0)
{
Message.Result= CallWindowProc(reinterpret_cast<FARPROC>(OriginalClientWndProc),ClientHandle,Message.Msg,Message.WParam,Message.LParam);
}
}