<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Delphi Tutorial &#187; Forms</title>
	<atom:link href="http://delphitutorial.info/category/delphi-tutorial/forms/feed" rel="self" type="application/rss+xml" />
	<link>http://delphitutorial.info</link>
	<description></description>
	<lastBuildDate>Sun, 19 Jul 2009 10:48:56 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to Create Rounded Form</title>
		<link>http://delphitutorial.info/how-to-create-rounded-form.html</link>
		<comments>http://delphitutorial.info/how-to-create-rounded-form.html#comments</comments>
		<pubDate>Wed, 07 Mar 2007 14:14:15 +0000</pubDate>
		<dc:creator>Delphi Tutorial</dc:creator>
				<category><![CDATA[Forms]]></category>

		<guid isPermaLink="false">http://delphitutorial.info/how-to-create-rounded-form.html</guid>
		<description><![CDATA[How to Create Rounded Form

procedure TForm1.FormCreate(Sender: TObject);
var
f : HRGN;
begin
Form1.Borderstyle := bsNone;
f := CreateRoundRectRgn(
0, // x-coordinate of the region&#8217;s upper-left corner
0, // y-coordinate of the region&#8217;s upper-left corner
clientwidth, // x-coordinate of the region&#8217;s lower-right corner
clientheight, // y-coordinate of the region&#8217;s lower-right corner
40, // height of ellipse for rounded corners
40); // width of ellipse for rounded corners
SetWindowRgn(Handle,f,True);
end;
Download: [...]]]></description>
			<content:encoded><![CDATA[<p>How to Create Rounded Form</p>
<p><span id="more-66"></span></p>
<p><font size="2" face="Courier New, Courier, mono"><strong>procedure </strong>TForm1.FormCreate(<strong>Sender</strong>: TObject);<br />
<strong>var</strong><br />
f : HRGN;<br />
<strong>begin</strong><br />
Form1.Borderstyle := bsNone;<br />
f := CreateRoundRectRgn(<br />
0, // x-coordinate of the region&#8217;s upper-left corner<br />
0, // y-coordinate of the region&#8217;s upper-left corner<br />
clientwidth, // x-coordinate of the region&#8217;s lower-right corner<br />
clientheight, // y-coordinate of the region&#8217;s lower-right corner<br />
40, // height of ellipse for rounded corners<br />
40); // width of ellipse for rounded corners<br />
SetWindowRgn(Handle,f,True);<br />
<strong>end</strong>;</p>
<p></font>Download: <a id="p65" href="http://delphitutorial.info/wp-content/uploads/2007/03/create-rounded-form.zip">Source Code</a></p>
]]></content:encoded>
			<wfw:commentRss>http://delphitutorial.info/how-to-create-rounded-form.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Create a Gradient Filled Form</title>
		<link>http://delphitutorial.info/how-to-create-a-gradient-filled-form.html</link>
		<comments>http://delphitutorial.info/how-to-create-a-gradient-filled-form.html#comments</comments>
		<pubDate>Fri, 02 Mar 2007 13:57:06 +0000</pubDate>
		<dc:creator>Delphi Tutorial</dc:creator>
				<category><![CDATA[Forms]]></category>

		<guid isPermaLink="false">http://delphitutorial.info/how-to-create-a-gradient-filled-form.html</guid>
		<description><![CDATA[You can create a gradient filled form to make form that is more beautiful.
procedure TForm1.FormPaint(Sender: TObject);
var
Row, Ht: Word;
begin
Ht := (ClientHeight + 255) div 256;
for Row := 0 to 255 do
with Canvas do
begin
Brush.Color := RGB(Row, 100, 0);
FillRect(Rect(0, Row*Ht, ClientWidth, (Row+1) * Ht));
end;
end;
You can change the value of (Row, 100, 0) to suite your preferences.
Example:
(Row, 255, 0) [...]]]></description>
			<content:encoded><![CDATA[<p>You can create a gradient filled form to make form that is more beautiful.<span id="more-64"></span></p>
<p><font size="2" face="Courier New, Courier, mono"><strong>procedure </strong>TForm1.FormPaint(Sender: TObject);<br />
<strong>var</strong><br />
Row, Ht: Word;<br />
<strong>begin</strong><br />
Ht := (ClientHeight + 255) div 256;<br />
<strong>for </strong>Row := 0 to 255 <strong>do</strong><br />
<strong>with </strong>Canvas <strong>do</strong><br />
<strong>begin</strong><br />
Brush.Color := RGB(Row, 100, 0);<br />
FillRect(Rect(0, Row*Ht, ClientWidth, (Row+1) * Ht));<br />
<strong>end</strong>;<br />
<strong>end</strong>;</p>
<p></font>You can change the value of (Row, 100, 0) to suite your preferences.</p>
<p>Example:</p>
<p>(Row, 255, 0) or (Row, 100, 255)</p>
<p><strong>Download</strong>: <a id="p63" href="http://delphitutorial.info/wp-content/uploads/2007/03/create-a-gradient-filled-form.zip">Source Code</a></p>
]]></content:encoded>
			<wfw:commentRss>http://delphitutorial.info/how-to-create-a-gradient-filled-form.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hide the titlebar</title>
		<link>http://delphitutorial.info/hide-the-titlebar.html</link>
		<comments>http://delphitutorial.info/hide-the-titlebar.html#comments</comments>
		<pubDate>Fri, 16 Feb 2007 06:45:32 +0000</pubDate>
		<dc:creator>Delphi Tutorial</dc:creator>
				<category><![CDATA[Forms]]></category>
		<category><![CDATA[Windows API]]></category>

		<guid isPermaLink="false">http://delphitutorial.info/hide-the-titlebar.html</guid>
		<description><![CDATA[Hide the titlebar.

Procedure TForm1.HideTitlebar;
var
Save : LongInt;
Begin
If  BorderStyle=bsNone then Exit;
Save:=GetWindowLong(Handle,gwl_Style);
If  (Save and ws_Caption)=ws_Caption then Begin
Case BorderStyle of
bsSingle,
bsSizeable : SetWindowLong(Handle,gwl_Style,Save and
(Not(ws_Caption)) or ws_border);
bsDialog :  SetWindowLong(Handle,gwl_Style,Save and
(Not(ws_Caption)) or  ds_modalframe or ws_dlgframe);
End;
Height:=Height-getSystemMetrics(sm_cyCaption);
Refresh;
End;
end;
And here is how we show it again:
Procedure TForm1.ShowTitlebar;
Var
Save : LongInt;
begin
If  BorderStyle=bsNone then Exit;
Save:=GetWindowLong(Handle,gwl_Style);
If  (Save and ws_Caption)ws_Caption then Begin
Case BorderStyle  of
bsSingle,
bsSizeable [...]]]></description>
			<content:encoded><![CDATA[<p>Hide the titlebar.<br />
<span id="more-43"></span></p>
<p><font size="2" face="Courier New, Courier, mono"><strong>Procedure </strong>TForm1.HideTitlebar;<br />
<strong>var</strong><br />
Save : LongInt;<br />
<strong>Begin</strong><br />
If  BorderStyle=bsNone then Exit;<br />
Save:=GetWindowLong(Handle,gwl_Style);<br />
If  (Save and ws_Caption)=ws_Caption then Begin<br />
<strong>Case </strong>BorderStyle <strong>of</strong><br />
bsSingle,<br />
bsSizeable : SetWindowLong(Handle,gwl_Style,Save and<br />
(Not(ws_Caption)) or ws_border);<br />
bsDialog :  SetWindowLong(Handle,gwl_Style,Save and<br />
(Not(ws_Caption)) or  ds_modalframe or ws_dlgframe);<br />
<strong>End</strong>;<br />
Height:=Height-getSystemMetrics(sm_cyCaption);<br />
Refresh;<br />
<strong>End</strong>;<br />
<strong>end</strong>;<br />
</font>And here is how we show it again:<br />
<font size="2" face="Courier New, Courier, mono"><strong>Procedure </strong>TForm1.ShowTitlebar;<br />
<strong>Var</strong><br />
Save : LongInt;<br />
<strong>begin</strong><br />
If  BorderStyle=bsNone then Exit;<br />
Save:=GetWindowLong(Handle,gwl_Style);<br />
If  (Save and ws_Caption)<>ws_Caption then <strong>Begin</strong><br />
<strong>Case </strong>BorderStyle  <strong>of</strong><br />
bsSingle,<br />
bsSizeable : SetWindowLong(Handle,gwl_Style,Save or<br />
ws_Caption or ws_border);<br />
bsDialog :  SetWindowLong(Handle,gwl_Style,Save or<br />
ws_Caption or ds_modalframe or  ws_dlgframe);<br />
<strong>End</strong>;<br />
Height:=Height+getSystemMetrics(sm_cyCaption);<br />
Refresh;<br />
<strong>End</strong>;<br />
<strong>end</strong>;<br />
</font></p>
]]></content:encoded>
			<wfw:commentRss>http://delphitutorial.info/hide-the-titlebar.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Hide the window caption</title>
		<link>http://delphitutorial.info/hide-the-window-caption.html</link>
		<comments>http://delphitutorial.info/hide-the-window-caption.html#comments</comments>
		<pubDate>Thu, 15 Feb 2007 06:47:15 +0000</pubDate>
		<dc:creator>Delphi Tutorial</dc:creator>
				<category><![CDATA[Forms]]></category>

		<guid isPermaLink="false">http://delphitutorial.info/hide-the-window-caption.html</guid>
		<description><![CDATA[If you want to prevent the user to move a window you have to hide the caption.  This is done by changing the window attributes in the FormCreate event.  Its  also possible to set the property BorderStyle to &#8216;bsNone&#8217;, but than the window  has no frame at all.
  procedure TForm1.FormCreate(Sender: [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to prevent the user to move a window you have to hide the caption.  This is done by changing the window attributes in the FormCreate event.  Its  also possible to set the property BorderStyle to &#8216;bsNone&#8217;, but than the window  has no frame at all.<br />
<span id="more-30"></span> <font size="2" face="Courier New, Courier, mono"> <strong>procedure </strong>TForm1.FormCreate(Sender: TObject);<br />
<strong>begin</strong><br />
SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle,GWL_STYLE) AND<br />
NOT  WS_CAPTION);<br />
ClientHeight := Height;<br />
Refresh;<br />
<strong>end</strong>;</p>
<p></font> This  code is disableing the flag WS_CAPTION in the window attributes.</p>
<p>The <strong>SetWindowLong</strong> function changes an attribute of the specified window. The function also sets a 32-bit (long) value at the specified offset into the extra window memory of a window.</p>
<p>LONG SetWindowLong(</p>
<p>HWND hWnd,Â Â Â  // handle of window<br />
int nIndex,Â Â Â  // offset of value to set<br />
LONG dwNewLong Â Â Â  // new value<br />
);</p>
]]></content:encoded>
			<wfw:commentRss>http://delphitutorial.info/hide-the-window-caption.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to make a desktop screenshot?</title>
		<link>http://delphitutorial.info/how-to-make-a-desktop-screenshot.html</link>
		<comments>http://delphitutorial.info/how-to-make-a-desktop-screenshot.html#comments</comments>
		<pubDate>Sun, 21 Jan 2007 12:07:47 +0000</pubDate>
		<dc:creator>Delphi Tutorial</dc:creator>
				<category><![CDATA[Forms]]></category>

		<guid isPermaLink="false">http://delphitutorial.info/how-to-make-a-desktop-screenshot.html</guid>
		<description><![CDATA[function  GetDesktopScreenShot:TBitmap;
var
Desktop:HDC;
begin
Result:= TBitmap.Create;
Desktop:= GetDC(0);
try
try
Result.PixelFormat :=  pf32bit;
Result.Width := Screen.Width;
Result.Height := Screen.Height;
BitBlt(Result.Canvas.Handle,0,0, Result.Width, Result.Height,  Desktop,0,0,SRCCOPY);
Result.Modified := True;
finally
ReleaseDC(0,Desktop);
end;
except
Result.Free;
Result:=nil;
end;
end;
procedure  TForm1.Button1Click(Sender: TObject);
begin
Image1.Picture.Bitmap := GetDesktopScreenShot;
end;  
]]></description>
			<content:encoded><![CDATA[<p><font size="2" face="Courier New, Courier, mono"><strong>function</strong>  GetDesktopScreenShot:TBitmap;<br />
<strong>var</strong><br />
Desktop:HDC;<br />
<strong>begin</strong><br />
Result:= TBitmap.Create;<br />
Desktop:= GetDC(0);<br />
<strong>try</strong><br />
<strong>try</strong><br />
Result.PixelFormat :=  pf32bit;<br />
Result.Width := Screen.Width;<br />
Result.Height := Screen.Height;<br />
BitBlt(Result.Canvas.Handle,0,0, Result.Width, Result.Height,  Desktop,0,0,SRCCOPY);<br />
Result.Modified := True;<br />
<strong>finally</strong><br />
ReleaseDC(0,Desktop);<br />
<strong>end</strong>;<br />
<strong>except</strong><br />
Result.Free;<br />
Result:=nil;<br />
<strong>end</strong>;<br />
<strong>end</strong>;</font><font size="2" face="Courier New, Courier, mono"></p>
<p><strong>procedure</strong>  TForm1.Button1Click(Sender: TObject);<br />
<strong>begin</strong><br />
Image1.Picture.Bitmap := GetDesktopScreenShot;<br />
<strong>end</strong>;  </font></p>
]]></content:encoded>
			<wfw:commentRss>http://delphitutorial.info/how-to-make-a-desktop-screenshot.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.220 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-09-08 13:58:51 -->
