Solved

FORM CAPTION

Posted on 2003-10-22
5
152 Views
Last Modified: 2010-07-27
How to change form cation size (height) & set picture ?

Thanks.
0
Comment
Question by:vbmn
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 17

Accepted Solution

by:
Wim ten Brink earned 500 total points
ID: 9598687
Not...
What most people do is use a form without a caption and draw their own caption inside it. It is possible to draw inside the caption, though, by capturing the WM_NCPAINT message aand drawing on the window provided by this message. There are several other WM_NCxxx messages available that can be useful. But changing the height? Not possible.
0
 
LVL 22

Expert Comment

by:Ferruccio Accalai
ID: 9598958
Why not possible to change the height?

Look the following:

unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs;

type
  TForm1 = class(TForm)
  private
     procedure WMNCPaint(var Msg: TWMNCPaint); message WM_NCPAINT;
  end;

var Form1: TForm1;

implementation
{$R *.dfm}

procedure TForm1.WMNCPaint(var Msg: TWMNCPaint);
var ACanvas: TCanvas;
    intLeftShift, intTopShift: Integer;
begin
  inherited;
  Form1.caption := '';
  ACanvas := TCanvas.Create;
  try
    ACanvas.Handle := GetWindowDC(Form1.Handle);
    with ACanvas do
    begin
      Brush.Style := bsclear;
      Font.Style := [fsItalic, fsBold];
      font.Height := 20;
      intLeftShift := GetSystemMetrics(SM_CYMENU) + GetSystemMetrics(SM_CXBORDER);
      intTopShift := (GetSystemMetrics(SM_CYCAPTION) - Abs(Font.Height)) div 2 + 2;
      TextOut(intLeftShift, intTopShift, 'Caption here')
    end;
  finally
    ReleaseDC(Form1.Handle, ACanvas.Handle);
    ACanvas.Free
  end;
end;
end.
0
 
LVL 22

Expert Comment

by:Ferruccio Accalai
ID: 9605231
I was wondering if my comment gave you any help...
If so maybe it should have some points too...
0
 
LVL 17

Expert Comment

by:Wim ten Brink
ID: 9615977
I have no problem sharing the points if your solution works. Does it?
0
 
LVL 22

Expert Comment

by:Ferruccio Accalai
ID: 9617875
Yes it does, but don't worry......
It's right so.....
F68 :-)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question