Postingan

Menampilkan postingan dengan label Delphi

How to find the printer on the network LAN

How to find the printer on the network LAN First: enter the unit and Winspool Printers in the uses clause. PsName parameter is the name of the computer in the network and store in TStrings. We can use the Combo or ListBox. The following snippets of source code it function TForm1.GetPrintServers(psName: string): TStrings; var lpBuffer,lpPrinterInfo: PChar; lcCount,lcNumCount : DWord ; liCount,liAux:integer; lsAuxNome:TStrings; function GetContexts ( pctipo : cardinal; ppName : PChar ):TStringlist; var liCont : integer; lsNome:string; lbPode:boolean; begin lbPode:=false; Result:=TStringlist.Create; case pcTipo of 8: lbPode := EnumPrinters(pctipo,ppName,1,PByte(lpBuffer),lcCount,lcCount, lcNumCount); 16: lbPode := EnumPrinters(pctipo,nil,1,PByte(lpBuffer),lcCount,lcCount, lcNumCount); end; if not lbPode then Exit; lpPrinterInfo := lpBuffer; for licont := 0 to lcNumCount - 1 do begin with PPrinterInfo1(lpPrinterInfo)^ ...

Components of checking the Class Components

Components of checking the Class Components In a program usually make it clear inputan form before the latest data on inputs. This is normally done to help the user distinguish between the input data with new data input koreks. When we use the components so TEdit we often use the command edit1.text :=''; means edit1 column blank value. sebgai example we will menginput student data before the new data submitted, we will clear the form input fields with the first. eNim.text:=''; eNama.text:=''; eAlamat.text:=''; and so forth. techniques such as this is not why, but sometimes make when we use saturated many tedit in a form inputan. so that the necessary rigor in order to provide one by one. There may be a function can overcome this problem. so we do not need to give commands on a component Tedit to clear the value. We undertake sufficient component of the class, if the component is Tedit then we fill with the value''or empty The following functions ...

Add Scrollbar in Listbox

HOW TO ADD SCROLLBAR IN LISTBOX In the default condition, ListBox not have horizontal scrollbar. If you want to add horizontal scrollbar in a ListBox component, can use the following procedure procedure SetHorizontalScrollBar(lb : TListBox) ; var j, MaxWidth: integer; begin MaxWidth := 0; for j := 0 to lb.Items.Count - 1 do if MaxWidth MaxWidth := lb.Canvas.TextWidth(lb.Items[j]) ; SendMessage(lb.Handle, LB_SETHORIZONTALEXTENT, MaxWidth + 5, 0) ; end; See ListBox

Listbox Delphi

LISTBOX DELPHI Many programs such as the popular music player iTunes or not, can drag and drop files in Windows Explorer directly into the list Playlistnya. Facilities drag and drop ListBox is a sophisticated, it can also create your own to explain the program with Delphi you. Do not believe?! So .. So if you believe, what I have examples that you can ngeDrag ListBox and drop such as iTunes or not. How easy .. You do not need but a scar, to be imprisoned under the tree later all. It is important you know the secret of how to manipulate the windows procedure for meresponds control messages sent. In case this is the message WM_DROPFILES, so that you can use it for the sake of your program. Here is an example of how to make ListBox can ngeDrag and Drop sekeren iTunes or not. So that you may add Stop, not an if you try to contact more with the Windows API functions such as "DragAcceptFiles'," DragQueryFile "and" DragFinish " Congratulations to try .. Do not for...

Delphi ListView

Below is an example of LISTVIEW IN DELPHI programming. Can someone write me code for this. object Form1: TForm1 Left = 199 Top = 176 Width = 544 Height = 375 Caption = 'Form1' Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'MS Sans Serif' Font.Style = [] OldCreateOrder = False PixelsPerInch = 96 TextHeight = 13 object ListView1: TListView Left = 56 Top = 24 Width = 417 Height = 137 Columns = item Caption = 'URL' Width = 200 end item Caption = 'INFO1' Width = 100 end item Caption = 'INFO2' end> Items.Data = { EC0000000400000000000000FFFFFFFFFFFFFFFF050000000000000015687474 703A2F2F7777772E676F6F676C652E636F6D0331303003323030033135300232 390000000000FFFFFFFFFFFFFFFF020000000000000014687474703A2F2F7777 772E676F6F676C652E696E0233320238390...

Array Types

Array types defines the list of elements with a certain type. You can usually use the index in square brackets to access one of the elements array. Angle brackets are also used to determine the value of the index when possible to define arrays. For example, you can specify a group that consists of 24 integer with the code as follows type DayTemperatures = array [1..24] of Integer; In the array definition, you must spend a subrange type in square brackets, or define a subrange type that uses two new constant with Ordinal type. Subrange this will determine the array index is valid. Because you determine the value of the index up and down from the array, the index does not need to be based from the value 0, such as that required in C, C + +, Java, and other programming languages. Because the index is based on the array subrange, Delphi can check their range as we have seen before. A constant subrange invalid will generate an error during the compilation, and when we use an index that ex...

Delphi Array

Component arrays is important in language programming. Similarly in Delphi. Therefore, knowledge of the array must be deep. Below is a discussion about the array of programing delphi . Below is an example of ARRAY in DELPHI programming : var Form1: TForm1; global arr: Array[1..10] of TCheckBox; procedure TForm1.FormCreate(Sender: TObject); var i,a,CtlTop : integer; begin CtlTop:=8; for i:=1 to 10 do begin arr[i]:=TCheckBox.Create(Self); arr[i].parent:=Self; CtlTop:=CtlTop+24; arr[i].Top:=CtlTop; arr[i].Caption :='Checkbox' + IntToStr(i); end; end;

Delphi Components

LIST OF DELPHI COMPONENTS XP Menu Components that can be used to display the menu and the tool bar to see as the tool bar menu and the MS Office XP. SMDBGrid DBGrid standard replacement parts, with some interesting features, such as footer, background, headers in the sorter, etc.. dxPack (Design eXperience) Components such as buttons in Windows XP. JEDI Code Library Contains hundreds of visual components and non-visual List of Article

Collection of articles delphi

Collection of articles delphi About Delphi Delphi Components Delphi Array Array Types Delphi ListView ListBox Delphi Add Scrollbar in Listbox Components of checking the Class Components How to find the printer on the network LAN

About Delphi

DELPHI Borland Delphi is developing a software package made by Borland. Version 11 and the latest version of the Delphi 2007 supports the Delphi programming language (Object Pascal) and C + + for 32 bit Microsoft Windows platform, and Delphi and C # for Microsoft. NET platform. Delphi programming language is the most popular programs used in the development of desktop applications and databases. Although delphi ability but more than that. Delphi is a product that is distributed as various suites: Personal, Professional, Enterprise (formerly Client / Server) and the Architect. List of Article