[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

FORM CAPTION

Posted on 2003-10-22
5
Medium Priority
?
154 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 2000 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 23

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 23

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 23

Expert Comment

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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

656 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