|
Export Data from VB 2008 to Excel |
|
|
|
សរសេរដោយ Setha IECH
|
|
ពុធ, 19 ឧសភា 2010 08:41 |
|
Private Sub btnExcel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExcel.Click Dim ExcelApp As Object, ExcelBook As Object Dim ExcelSheet As Object Dim i As Integer Dim j As Integer 'create object of excel ExcelApp = CreateObject("Excel.Application") ExcelBook = ExcelApp.WorkBooks.Add ExcelSheet = ExcelBook.WorkSheets(1) With ExcelSheet For i = 1 To Me.DataGridView1.RowCount .cells(i, 1) = Me.DataGridView1.Rows(i - 1).Cells("id").Value For j = 1 To DataGridView1.Columns.Count - 1 .cells(i, j + 1) = DataGridView1.Rows(i - 1).Cells(j).Value Next Next End With ExcelApp.Visible = True 'set page margin ExcelSheet.PageSetup.PaperSize = 9 ExcelSheet.PageSetup.LeftMargin = ExcelApp.InchesToPoints(0.3) ExcelSheet.PageSetup.RightMargin = ExcelApp.InchesToPoints(0.3) ExcelSheet.PageSetup.TopMargin = ExcelApp.InchesToPoints(0.3) ExcelSheet.PageSetup.BottomMargin = ExcelApp.InchesToPoints(0.3) ExcelSheet.PageSetup.CenterHorizontally = True ' ExcelSheet = Nothing ExcelBook = Nothing ExcelApp = Nothing
End Sub Download Source Code Here |
|
|
Draw Cambodian Map in Turbo C++ |
|
|
|
សរសេរដោយ Setha IECH
|
|
ព្រហស្បតិ, 13 ឧសភា 2010 11:03 |
|
This map is not a real map, it uses for education only. 
#include <stdio.h> #include <conio.h> #include <dos.h> #include <string.h> #include <graphics.h> #include <stdlib.h> #include <bios.h> #include <ctype.h> #include <dos.h> union REGS in_regs , out_regs ; int initmouse() { in_regs.x.ax = 0 ; int86(0x33,&in_regs,&out_regs) ; return out_regs.x.ax ; } void show_mouse(){ in_regs.x.ax = 1;int86(0x33,&in_regs,&out_regs); } void hide_mouse(){ in_regs.x.ax = 2;int86(0x33,&in_regs,&out_regs); } int mouse_press(int &button,int &dx,int &dy) { in_regs.x.ax = 3; int86(0x33,&in_regs,&out_regs); button = out_regs.x.bx ; dx = out_regs.x.cx; dy = out_regs.x.dx; return button; } ---------------------------------- moveto(1,263); lineto(13,265);lineto(22,275);lineto(26,274); lineto(24,258);lineto(28,257);lineto(32,267);lineto(48,270); lineto(46,260);lineto(42,250);lineto(41,235);lineto(43,233); lineto(45,236);lineto(44,226);lineto(34,218);lineto(33,214); ---------------------------------- Download Source Code Here (* Note: Please copy both files above into \Bin folder of Turbo C++) |
|
VB.Net 2008 OleDb Connect to MS-Access with Password (Visual Basic 2008) |
|
|
|
សរសេរដោយ Setha IECH
|
|
អង្គារ, 11 ឧសភា 2010 10:24 |
|
Dim con As New OleDb.OleDbConnection con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & _ Application.StartupPath & "\dbstudent.mdb;" & _ "Jet OLEDB:Database Password=12345" con.Open() '---------------------- Dim da As New OleDb.OleDbDataAdapter("SELECT * FROM tblstudent", con) '---------- con.Close() con.Dispose() |
|
VB6 Connect to MS-Access with Password (Visual Basic 6) |
|
|
|
សរសេរដោយ Setha IECH
|
|
អង្គារ, 11 ឧសភា 2010 08:36 |
|
Dim db As New ADODB.Connection Dim rec As New ADODB.Recordset Dim recCount As Integer db.ConnectionString = "Provider=MSDASQL.1;Persist Security Info=False;" & _ "Data Source=MS Access Database;" & _ "Initial Catalog=" & App.Path & "\dbstudent.mdb; Password=12345" db.Open rec.Open "SELECT * FROM tblStudent ORDER BY [name]", db, 3, 2 recCount = rec.RecordCount .............................................. |
|
Create Hang Man Game in Visual Basic 6 |
|
|
|
សរសេរដោយ Setha IECH
|
|
ពុធ, 05 ឧសភា 2010 13:44 |
|
----------------------------------------------- Dim i As Integer: i = 1 Dim isCorrectWord As Boolean: isCorrectWord = False Dim MyWord As String While Mid(MyStr, i, 1) & "" <> "" If Mid(MyStr, i, 1) = Right(txtLetter.Text, 1) Then MyWord = MyWord & Right(txtLetter.Text, 1) If Mid(lblWordGuess.Caption, i, 1) <> _ Right(txtLetter.Text, 1) Then _ isCorrectWord = True Else MyWord = MyWord & Mid(lblWordGuess.Caption, i, 1) End If i = i + 1 Wend txtTotalGuess = txtTotalGuess + 1 If Not isCorrectWord Then txtWrongGuess = txtWrongGuess + 1 If txtWrongGuess = 1 Then shapeHead.Visible = True If txtWrongGuess = 2 Then lineEye1.Visible = True: lineEye2.Visible = True lineEye3.Visible = True: lineEye4.Visible = True lineNose.Visible = True: lineMouth.Visible = True End If If txtWrongGuess = 3 Then lineNeck.Visible = True If txtWrongGuess = 4 Then lineHandL.Visible = True If txtWrongGuess = 5 Then lineHandR.Visible = True If txtWrongGuess = 6 Then lineBody.Visible = True If txtWrongGuess = 7 Then lineLegL.Visible = True If txtWrongGuess = 8 Then lineLegR.Visible = True End If --------------------------------------------------- Download Source Code Here |
|
|
|
|
|
|
ទំព័រ 2 នៃ 5 |