上一页 1 ··· 30 31 32 33 34 35 36 37 38 ··· 49 下一页
摘要: #include <stdio.h>void main(void) { char *weekdays[7] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}; int i; for (i = 0; i < 7; i++) printf("weekdays[%d] contains %s\... 阅读全文
posted @ 2012-06-04 12:30 XE2011 阅读(92) 评论(0) 推荐(0)
摘要: #include <conio.h>void main(void) { int row, column; clrscr(); cprintf("This is line 1\r\n"); cprintf("Line 2 is a little longer\r\n"); cprintf("This is the last line"); row = wherey(); column = where... 阅读全文
posted @ 2012-06-04 12:30 XE2011 阅读(99) 评论(0) 推荐(0)
摘要: #include <stdio.h>void main(void) { enum { Monday, Tuesday, Wednesday, Thursday, Friday } day; for (day = Monday; day <= Friday; day++) if (day == Monday) printf("No fun---meetings all day Monday\n");... 阅读全文
posted @ 2012-06-04 12:30 XE2011 阅读(132) 评论(0) 推荐(0)
摘要: #include <stdio.h>#include <string.h>void main (void) { char line[255]; // Line of text read while (fgets(line, sizeof(line), stdin)) fputs(strupr(line), stdout); }通过 Wiz 发布 阅读全文
posted @ 2012-06-04 12:29 XE2011 阅读(115) 评论(0) 推荐(0)
摘要: #include <stdio.h>Main () { printf ("This program does not compile."); }通过 Wiz 发布 阅读全文
posted @ 2012-06-04 12:29 XE2011 阅读(101) 评论(0) 推荐(0)
摘要: #include <stdio.h>void hello_world(void) { printf("Hello, world!\n"); }void main(void) { hello_world(); }通过 Wiz 发布 阅读全文
posted @ 2012-06-04 12:29 XE2011 阅读(142) 评论(0) 推荐(0)
摘要: procedure TForm1.Button1Click(Sender: TObject);beginSendMessage(ComboBox1.Handle, CB_SHOWDROPDOWN, 1,0);end;通过 Wiz 发布 阅读全文
posted @ 2012-06-03 17:56 XE2011 阅读(253) 评论(0) 推荐(0)
摘要: //WM_PAINT带背景的窗体private{ Private declarations }Bitmap:TBitmap;procedure WMPaint(var msg:TWMPAINT);Message WM_PAINT;procedure TForm1.WMPaint(var msg:TWMPAINT);begininherited;StretchBlt(canvas.Handle,0,... 阅读全文
posted @ 2012-06-03 17:56 XE2011 阅读(479) 评论(0) 推荐(0)
摘要: //sendmessage WM_PAINT带背景的窗体private{ Private declarations }Bitmap:TBitmap;procedure WMPaint(var msg:TWMPAINT);Message WM_PAINT;procedure TForm1.WMPaint(var msg:TWMPAINT);begininherited;StretchBlt(canv... 阅读全文
posted @ 2012-06-03 17:56 XE2011 阅读(219) 评论(0) 推荐(0)
摘要: //TMemo组件的光标定位privateprocedure MemoRow;{ Private declarations }varForm1: TForm1;procedure TForm1.MemoRow;varLpos,Cpos,LineLength:Integer;beginLpos := SendMessage(Memo1.Handle,em_linefromchar,Memo1.Sel... 阅读全文
posted @ 2012-06-03 17:56 XE2011 阅读(427) 评论(0) 推荐(0)
摘要: procedure TForm1.Button1Click(Sender: TObject);varhandle:integer;aBool:Boolean;beginSystemParametersInfo(SPI_GETSCREENSAVEACTIVE,0,@aBool,0);if aBool thenbeginhandle:=Findwindow('shell_traywnd',nil);S... 阅读全文
posted @ 2012-06-03 17:55 XE2011 阅读(87) 评论(0) 推荐(0)
摘要: http://www.websnap123.com/http://delphi.about.com/http://www.2ccc.com/http://www.delphifans.com/http://www.tommstudio.com/http://www.xuedelphi.cn/通过 Wiz 发布 阅读全文
posted @ 2012-06-03 17:55 XE2011 阅读(157) 评论(0) 推荐(0)
摘要: //With简化代码语句{With语句是一种用于简化代码的语句。如你要访问一个记录类型变量(或一个对象),用With语句就不必每次重复变量的名字with 对象名 dobegin对象名属性 := 属性值;end;}//例1with Button1 dobegincaption := 'Btn';width := 100;end;//例2with edit1 dobegintext := 'Hello... 阅读全文
posted @ 2012-06-03 17:55 XE2011 阅读(106) 评论(0) 推荐(0)
摘要: //简单语句和复合语句简单语句Pascal 简单语句中不包含任何别的语句,赋值语句和过程调用即是简单语句的例子。简单语句用分号隔开,如下所示:X := Y + Z; // assignmentRandomize; // procedure call复合语句用begin 和end 将简单语句括起来即组成复合语句,复合语句用法与普通的Pascal 语句相同,见下例:beginA := B;C := A... 阅读全文
posted @ 2012-06-03 17:55 XE2011 阅读(231) 评论(0) 推荐(0)
摘要: //设置TMemo组件的边界procedure TForm1.Button1Click(Sender: TObject);vararea: TRect;beginSendMessage(memo1.Handle ,em_getrect,0,longint(@area));area.Left := 30;area.Top := 10;area.Right := area.Right - 29;are... 阅读全文
posted @ 2012-06-03 17:55 XE2011 阅读(92) 评论(0) 推荐(0)
上一页 1 ··· 30 31 32 33 34 35 36 37 38 ··· 49 下一页