[Article] How to use Delphi to control Excel storage grid merge? [Edit] Pilot angel [Author] A6475 [Invo] Source: http://delphi.ktop.com.tw/topic.asp? Topic_ID = 45774
Q: I use the following methods to dynamically create the Create Excel OLE object msexcel: = CreateoleObject ('Excel.Application');
1. I want to consolidate the A1..Z1 Cell, what is the directive? How do I know Cell [2, 3] = B3, Cell [1, 1] = A12. In the past, we all specified Cell [2,3] The inner value, but if you want to know that it is the site? (In addition to using the calculation formula, there is no instruction to know)
A: 1.Myexcel.Range ['C1', 'D8']. Select; myexcel.selection.merge; // Complete storage 2.cell [1,3] .addressorcell [1,3] .address (XLA1 3. The following is C Builder to take an Excel's Cell Merge method.
// Merged Cell / * Cells = Worksheet.olePropertyget ("cells"); variant cell1 = cells.olepropertyget ("cells", x1, y1); variant cell2 = cells.olePropertyget ("cells", x2, y2); Range = Worksheet.olePropertyget ("Range", Cell1, Cell2); Range.OLEFUNCTION ("Merge"); 4. Reference This: http://delphi.ktop.com.tw/topic.asp? Topic_ID = 28371
[Article] How to change the font of ShowMessage? [Edit] Pilot Angel [Author] LiOREX [Invo] Source: http://delphi.ktop.com.tw/topic.asp? Topic_ID = 29646
Var from: TForm; Lab: TLABEL; Begin from: = CreateMessageDialog ('afsdfadsfasd', mtinformation, [mbok]); with from do beg Lab: = TLabel (Findcomponent); if Lab <> NIL THEN BEGIN Lab.Font.Color: = CLRED; // The color you want is lab.font.size: = 12; // font lab.font.name: = 'standards'; // font end; from. SHOWMODAL; "From.Destroy; FreeAndnil (from);
END;
[Article] How to open the string of the tend to connect? [Edit] The angel [Author] Qoo1234 / Pd [Invo] Source: http://delphi.ktop.com.tw/topic.asp? Topic_ID = 45586q : How do I open the string?
S: = 'ABC, BBB, CCC, AAA, ADD, DDC';
How to separate it from: abcbbbcccaaaAadddddc
A1:
Procedure TForm1.Button1Click (Sender: Tobject); Var str: string; sl: tstringlist; begin str: = 'ABC, BBB, CCC, AAA, ADD, DDC'; SL: = TstringList.create; sl .commatext: = STR ShowMessage (sl.text); sl.Free; end; A2:
Function Tsysut.GetaryStr (var Arylist: array s: boolean; var xpos: string; xfind: integer; i: integer; begin xpos: = '; xfind: = -1; result: = true; i: = 0; while xfind <> 0 do try xfind: = POS (',', mstring); if xfind = 0 Then Break; xpos: = copy (mstring, 1, xfind-1); Arylist [i]: = XPOS; Delete (Mstring, 1, Length (XPOS) 1); Inc (i); Except ON E: Exception Do Begin Result: = FALSE; BREAK; END; END;
Usage myary: = array [0..3] of string; mystr: = 'AAA, BBB, CCC, DDD'
GetaryStr (myary, mystr); you can find that you will automatically send four sets of strings to four arrays. You will use your creative to use it!