SETHA SITE INFORMATION

  • Increase font size
  • Default font size
  • Decrease font size
SETHA SITE INFORMATION

How to Create Dictionary English-English in Turbo C++

E-mail Print PDF

This article shows how to create dictionary of English-English-Khmer in Turbo C++ programming language. From this sample, you will see how to:

  • Use graphic mode in Turbo C++
  • Use mouse pointer in Turbo C++
  • Create user interface looks seemly like the GUI (graphic user interface) in windows application too like button style, menu style, scroll bar, etc. which are fully drawn by coding in Turbo C++.
  • Use Object Oriented Programming in Turbo C++



Sample Code of Class Mouse Pointer

/* Class of Mouse pointer */
union REGS inregs,outregs;
class mouseobj {
	public:
	   int  init();
	   void show( void );
	   void hide( void );
	   void horiz_limit( int minx, int maxx );
	   void vert_limit( int miny, int maxy );
	   int  press();
	   int post( int left, int top, int right, int buttom);
	     };
int mouseobj::init(){
	inregs.x.ax = 0;
	int86(0x33,&inregs,&outregs);
	return outregs.x.ax;
		     }

void mouseobj::show(){
	inregs.x.ax = 1;
	int86(0x33,&inregs,&outregs);
		    }
Download Sample Here
 

VB Programming: MSHFlexGrid Input TextBox in VB6

E-mail Print PDF

This sample shows how to use input text box and check box in MHSFlexGrid Control in VB6. Normally, we cannot entry value directly into MHSFlexGrid’s cells, so we need to create our own textbox and place to each cell programmatically to entry value or change value of the MHSFlexGrid’s cells.

In this sample, please use to move cell, to enter value or to enter value. You also can on each cell to change text color and background color of the current cell.



 
Download Full Source Code
 

VB Programming: Drive Show and Folder Show in VB6

E-mail Print PDF

This is VB6 sample code use to show all drives exist in your computer. Drill down or expand each drive to see more folders and files.


Sample Code
Option Explicit
Private fso

Private Sub Form_Load()
    Show
    Dim Drv
    Dim nodeX As Node
    Dim nodeY As Node
    Set fso = CreateObject("Scripting.FileSystemObject")
    For Each Drv In fso.Drives
        Set nodeX = TreeView1.Nodes.Add(, , Drv.Path, Drv.DriveLetter, 1)
        Set nodeY = TreeView1.Nodes.Add(nodeX, tvwChild)
    Next
End Sub

Private Sub TreeView1_Expand(ByVal Node As MSComctlLib.Node)
    On Error Resume Next
    Dim lPath As String
    Dim fDir, fName, ffile, ffname
    Dim fNode As Node
    Dim nNode As Node
    lPath = Node.Key
    Do While Node.Children > 0
        TreeView1.Nodes.Remove Node.Child.Index
    Loop
    If Right(lPath, 1) <> "\" Then lPath = lPath & "\"
    
    Set fDir = fso.GetFolder(lPath)
    
    For Each fName In fDir.subfolders
            Set fNode = TreeView1.Nodes.Add(Node.Key, tvwChild, _
                                            fName.Path, fName.Name, 2)
            Set nNode = TreeView1.Nodes.Add(fName.Path, tvwChild)
    Next

    Set ffname = fDir.Files
    Dim x As Long
    
    For Each fName In ffname
        x = fName.Size \ 1024
        Set fNode = TreeView1.Nodes.Add(Node.Key, tvwChild, _
                                        fName.Path & fName.Name, fName.Name & "   " & _
                                        IIf((x \ 1024) > 0, x \ 1024 & " MB", _
                                                            IIf(x > 0, x & " KB", _
                                                            fName.Size & " bytes")), 3)
    Next
End Sub
Download Sample Code Here
 

Turbo C++ Programming: Create Clock in Turbo C++

E-mail Print PDF

This is a sample code of Turbo C++ programming language in graphic mode use to create Clock using Date and Time of computer machine. Relating to this sample, I use some of mathematics theories such as cosine and sine.


Press <ESC> key to quit the application.
 
Download Full Source Code
 

Turbo C++ Programming: Create Calendar in Turbo C++

E-mail Print PDF

This sample code is the creation of Calendar which the holiday’s date based on Cambodian holiday.


Download Full Source Code
 


Page 17 of 19