当前位置:编程学习 > C#/ASP.NET >>

小女子高分求救!!!窗口右上角最大最小化按钮如何融合??

我用delphi开发的应用程序,新建一个窗口,窗口本身有“最大最小关闭”按钮;然而因界面风格要求,需要换上一套新的“最大最小关闭”按钮,所以现在的问题是,一运行就出现两套图标,非常别扭;如果去掉窗口本身那套,则窗口没有右键功能;所以,如何实现,这两套按钮的融合,显示的是那套统一风格的“最大最小关闭”按钮,同时又有右键功能。 --------------------编程问答-------------------- 沙发,帮忙顶 --------------------编程问答-------------------- 就是无边框的窗体,插进自己的界面图,为标题栏增加无边框拖动代码,为大小关闭钮增加相应代码

你可以加群:6324513 大家讨论讨论 --------------------编程问答-------------------- 学习中~帮你顶 --------------------编程问答-------------------- 设计个无边框,自己控制,我就是那么做的! --------------------编程问答-------------------- 学习 --------------------编程问答-------------------- 是的﹐通常情況就是自己控制比較方便﹐這種控制功能在WWW.DELPHIBOX.COM上有討論 --------------------编程问答-------------------- 既然你写出新的最大最小的一套按纽 添加个右键还是问题吗 --------------------编程问答-------------------- 回帖是一种美德!传说每天回帖即可获得 10 分可用分! --------------------编程问答-------------------- 好久好久没看到有人提这种问题了!!
怀念旧时光…… --------------------编程问答-------------------- 学习 --------------------编程问答-------------------- 使用无边框窗体 --------------------编程问答-------------------- 使用无边框窗体 --------------------编程问答-------------------- 使用无边框窗体,在窗体属性里borderstyle设成none,然后你再你自己的最小池大化等按钮,自己增加事件写代码,就可以了 --------------------编程问答-------------------- 1. 无边框窗体也可以在FormCreate中实现,如:
procedure TForm1.FormCreate(Sender: TObject);
begin
borderstyle:=bsnone;  //不用标题行
end;

2. 响应右键,可以利用MouseDown事件,例如,
假设你用speedButton1模拟最小化按钮,则响应
右击最小化按钮的程序形式为:

procedure TForm1.SpeedButton1MouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  if button=mbright then
   begin
    showmessage('to minimize the window.');
   end;
end;

3.以下是一个简单化了的模拟程序,

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ComCtrls, ToolWin, Buttons, Menus;

type
  TForm1 = class(TForm)
    CoolBar1: TCoolBar;
    SpeedButton1: TSpeedButton;
    SpeedButton2: TSpeedButton;
    SpeedButton3: TSpeedButton;
    procedure FormCreate(Sender: TObject);
    procedure SpeedButton1Click(Sender: TObject);
    procedure SpeedButton2Click(Sender: TObject);
    procedure SpeedButton3Click(Sender: TObject);
    procedure SpeedButton1MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure SpeedButton2MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure SpeedButton3MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
width:=600;
height:=400;
align:=alNone;
position:=poScreenCenter;
BorderStyle:=bsnone;  //不用标题行
speedbutton1.left:=width-3*speedbutton1.width-10;
speedbutton2.left:=width-2*speedbutton1.width-10;
speedbutton3.left:=width-speedbutton1.width-10;
speedbutton1.Caption:='-';
speedbutton2.Caption:='口';
speedbutton3.Caption:='X';
end;

//最小化窗体
procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
Form1.WindowState:=wsMinimized;//application.Minimize;
end;

//右击最小化按钮
procedure TForm1.SpeedButton1MouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  if button=mbright then
   begin
    showmessage('to minimize the window.');
   end;
end;

//最大化窗体
procedure TForm1.SpeedButton2Click(Sender: TObject);
begin
Form1.WindowState:=wsMaximized
end;

//右击最大化按钮
procedure TForm1.SpeedButton2MouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  if button=mbright then
   begin
    showmessage('to maximize the window.');
   end;
end;

//退出系统
procedure TForm1.SpeedButton3Click(Sender: TObject);
begin
close
end;

//右击退出系统按钮
procedure TForm1.SpeedButton3MouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
  if button=mbright then
   begin
    showmessage('to close the window.');
   end;
end;

end.

//当然,程序还有进一步改进的地方,


--------------------编程问答-------------------- 不用FORM单元  从TWinControl直接继承 不过要对API比较熟悉   --------------------编程问答-------------------- --------------------编程问答-------------------- 算了吧,我发现就算连源代码等整套方案都给出来了,都不会得到技术分!
到目前为止,都没见过说有哪位完整回复了能解决问题的方案,而得到回报!
--------------------编程问答-------------------- 问题解决了
应该有的 --------------------编程问答-------------------- 学习  学习
补充:.NET技术 ,  其他语言
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,