放置 [TabControl],並建立二個 [TabItem],TabControl.TabPosition屬性設置為None,如下圖
2020年11月11日 星期三
【Delphi Multi-Device Application】 觸控頁面滑動切換
2020年10月31日 星期六
【Delphi Multi-Device Application】 Button.Click 觸發頁面滑動切換
放置 [TabControl],並建立二個 [TabItem],TabControl.TabPosition屬性設置為None,如下圖
![]() |
| TabControl設定 |
2020年9月18日 星期五
同樣是二戰戰敗國,為什麼德國擁有國防軍,而日本只有「自衛隊」
原文網址:https://kknews.cc/history/rb4y8br.html
同樣是二戰戰敗國,為什麼德國擁有國防軍,而日本只有「自衛隊」
2018-07-26 由 軍林天下 發表于歷史
作為二戰戰敗國,德國和日本都被解除了武裝,照著《開羅宣言》和《波斯坦公告》來講,這兩個國家都不應該再擁有軍隊,然而為何現在德國擁有軍隊,日本卻沒有軍隊呢?
來看德國,德國有軍隊,而且是被歐美等國認可的。戰敗後的德國軍隊就地解散,國土分別被蘇聯和美國占領,分裂為東德和西德。蘇聯和美國本來就不對付,二戰剛結束那邊就開始冷戰。為了一決高下,東德和西德自然成了前沿戰場,蘇聯更是暗自組建東德軍隊。美國也不甘示弱,立即暗示西德也可以擁有自己的軍隊。於是本來就地解散的德國軍隊又回來了,西德第一任總理康拉德·阿登納在萊茵蘭-普法爾茨組建了新西德軍隊,並將軍隊改名為「聯邦國防軍」。
日本沒有軍隊,卻有一個和軍隊差不多意思的自衛隊。日本也是在1945年戰敗後被剝奪了武裝,軍事機構也被解散,美國直接大軍進駐日本。隨後,日本政府頒布《和平憲法》,宣布放棄戰爭放棄武力放棄宣戰權。整個日本幾乎成了美國的「中轉站」。直到韓戰爆發,美國發現日本手頭連拿的出手的警察都沒有,為了保證「中轉站」的「安全」,指示日本組建國家警察預備隊。到了1954年,日本政府受到美國指點,專門頒布了「防衛兩法」,日本自衛隊就出現在大家面前了。
日本自衛隊明面上是日本的警察隊伍,但是時至今日已經成為沒有名分的軍隊。一個警察隊伍,人數已經達到28萬餘人,甚至軍費與英法相當,排世界第五。日本右翼勢力近幾年瘋狂提出修改憲法的要求,出台各種海外派兵法,和美國簽訂安保協議,甚至直接出兵伊拉克、阿富汗。這支不是軍隊的日本自衛隊,在亞洲軍事實力排名相當靠前,比其他國家正規軍規模都要大,裝備、戰鬥力都要強。
2020年8月25日 星期二
Delphi 中GetLogicalDriveStrings 讀取磁碟代號列表
2020年7月30日 星期四
QuickReportLib.pas 記錄
2020年7月28日 星期二
TRegistry 操作
2020年7月27日 星期一
2020年7月24日 星期五
Client:TSocketConnection和Server:Scktsrvr關系----壓縮數據傳輸
2020年7月20日 星期一
Display Menu Item Hints
2020年6月30日 星期二
Delphi 執行檔,程式碼執行無法繼續,因為找不到Borlndmm.dll。...
在字串中重複的出現次數
2020年6月25日 星期四
...import an Excel Table to a TStringgrid?
2020年6月9日 星期二
Table 分組後取最大的資料列
2020年4月27日 星期一
C# PadLeft / PadRight 字串補指定字元
string str="A";
str.PadLift(3,'0'); --> 00A 左邊補指定字元
str.PadRight(3, '0'); --> A00 右邊補指定字元
2020年4月21日 星期二
C# InputBox 輸入視窗
using System.Drawing;
public static DialogResult InputBox(string title, string promptText, ref string value)
{
Form form = new Form();
Label label = new Label();
TextBox textBox = new TextBox();
Button buttonOk = new Button();
Button buttonCancel = new Button();
form.Text = title;
label.Text = promptText;
textBox.Text = value;
buttonOk.Text = "OK";
buttonCancel.Text = "Cancel";
buttonOk.DialogResult = DialogResult.OK;
buttonCancel.DialogResult = DialogResult.Cancel;
label.SetBounds(9, 20, 372, 13);
textBox.SetBounds(12, 36, 372, 20);
buttonOk.SetBounds(228, 72, 75, 23);
buttonCancel.SetBounds(309, 72, 75, 23);
label.AutoSize = true;
textBox.Anchor = textBox.Anchor | AnchorStyles.Right;
buttonOk.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
buttonCancel.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
form.ClientSize = new Size(396, 107);
form.Controls.AddRange(new Control[] { label, textBox, buttonOk, buttonCancel });
form.ClientSize = new Size(Math.Max(300, label.Right + 10), form.ClientSize.Height);
form.FormBorderStyle = FormBorderStyle.FixedDialog;
form.StartPosition = FormStartPosition.CenterScreen;
form.MinimizeBox = false;
form.MaximizeBox = false;
form.AcceptButton = buttonOk;
form.CancelButton = buttonCancel;
DialogResult dialogResult = form.ShowDialog();
value = textBox.Text;
return dialogResult;
}
Ex:
string value = "Document 1";
if (Tmp.InputBox("New document", "New document name:", ref value) == DialogResult.OK)
{
myDocument.Name = value;
}
轉貼至 https://dotblogs.com.tw/aquarius6913/2014/09/03/146444
2020年3月24日 星期二
C# MessageBox 常用語法
DialogResult result;
result = MessageBox.Show("Are you OK?", "Question",
MessageBoxButtons.YesNo,
MessageBoxIcon.Question);
if (result = DialogResult.Yes)
{
...
}
2020年3月20日 星期五
C# DevExpress PopupMenu
2020年3月5日 星期四
Which is the best way to load a string (HTML code) in TWebBrowser?
var
Doc: Variant;
begin
if NOT Assigned(wbBrowser.Document) then
wbBrowser.Navigate('about:blank');
Doc := wbBrowser.Document;
Doc.Clear;
Doc.Write(HTMLCode);
Doc.Close;
end;
https://stackoverflow.com/questions/39773033/which-is-the-best-way-to-load-a-string-html-code-in-twebbrowser
2020年2月25日 星期二
URLDownloadToFile - some pages is not download
Earlier in the evening I had read that you need to make sure COM is initialized for the thread. I disregarded this and plowed on - this was fine when I used Win7 and Vs2010.
Anyway, the fix was to use CoInitialize(NULL); before the call to URLDownloadToFile - after this change, hRes holds S_OK afterwards. :)
Listing as tested with VS2005 in XP
Hide Copy Code
#include "stdafx.h"
#include <windows.h>
#include <urlmon.h>
int main()
{
CoInitialize(NULL);
HRESULT hRes;
hRes = URLDownloadToFile(NULL, L"http://www.google.com/", L"google.com.file", 0, NULL);
return 0;
}
Posted 12-Aug-12 9:03am
enhzflep
https://www.codeproject.com/Questions/439137/URLDownloadToFile-some-pages-is-not-download
DELPHI TDownLoadURL下载网络文件
unit Unit1;
interface
uses
//引用 Vcl.ExtActns
Vcl.ExtActns,
System.SysUtils, System.Types, System.UITypes, System.Classes,
System.Variants,
FMX.Types, FMX.Graphics, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.StdCtrls,
IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdHTTP, FMX.Edit;
type
TForm1 = class(TForm)
GroupBox1: TGroupBox;
ProgressBar1: TProgressBar;
Edit1: TEdit;
GroupBox2: TGroupBox;
Edit3: TEdit;
Edit4: TEdit;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
procedure URL_OnDownloadProgress(Sender: TDownLoadURL;
Progress, ProgressMax: Cardinal; StatusCode: TURLDownloadStatus;
StatusText: String; var Cancel: Boolean);
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.fmx}
var
DownLoadURL1:TDownLoadURL;
//url=网络文件 'http://helloroman.oicp.net:8000/test.rar';
//Filename=保存到本地文件 'D:\Administrator\Desktop\123.rar';
function DownLoadFile(url,Filename:string):boolean;
var
DownLoadURL1:TDownLoadURL;
begin
try
DownLoadURL1:=TDownLoadURL.Create(Form1);
DownLoadURL1.URL:= url;
DownLoadURL1.Filename:= Filename;
DownLoadURL1.OnDownloadProgress:=Form1.URL_OnDownloadProgress;
DownLoadURL1.ExecuteTarget(nil);
DownLoadURL1.Free;
Result:=true;
except
Result:=false;
end;
end;
procedure DownLoadThread;
begin
Form1.label3.Text:='0 kb / 0 kb';
if DirectoryExists(ExtractFilePath(Form1.edit4.text)) then
begin
if not DownLoadFile(Form1.edit3.text,Form1.edit4.text) then
Form1.GroupBox1.Text:='下载失败'
else
Form1.GroupBox1.Text:='下载完毕';
end
else
SHowMessage(Form1.edit4.text + '不存在!');
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
TThread.CreateAnonymousThread(DownLoadThread).Start;
end;
function BytesToStr(iBytes: Integer): String;
var
iKb: Integer;
begin
iKb := Round(iBytes / 1024);
if iKb > 1000 then
Result := Format('%.2f MB', [iKb / 1024])
else
Result := Format('%d KB', [iKb]);
end;
// 获取网络文件名
function GetUrlFileName(url:string):string;
var
str:string;
begin
url:=StringReplace(StrRScan(PChar(url),'/'), '/', '',[rfReplaceAll]);
if Pos('=',url) > 0 then
url:=StringReplace(StrRScan(PChar(url),'='), '=', '',[rfReplaceAll]);
Result:=url;
end;
procedure TForm1.URL_OnDownloadProgress(Sender: TDownLoadURL;
Progress, ProgressMax: Cardinal; StatusCode: TURLDownloadStatus;
StatusText: String; var Cancel: Boolean);
begin
ProgressBar1.Max := ProgressMax div 100;
ProgressBar1.Value := Progress div 100;
Caption := StatusText;
case StatusCode of
dsFindingResource:GroupBox1.Text:='查找资源...';
dsConnecting:GroupBox1.Text:='连接中...';
dsRedirecting:GroupBox1.Text:='';
dsBeginDownloadData:GroupBox1.Text:='准备下载文件...';
dsDownloadingData:GroupBox1.Text:='下载中...';
end;
Edit1.Text:= Format('文件名:%s',[GetUrlFileName(Edit3.Text)]);
label3.Text := Format('%s / %s', [BytesToStr(Progress),BytesToStr(ProgressMax)]);
end;
end.
http://www.cnblogs.com/xe2011/p/3719454.html












