Tuesday, December 23, 2008

How to Moving & Resizing Forms And Controls Through Code

How to Moving & Resizing Forms And Controls Through Code

Create a new Window Application. Here the name of the application is MovingAndResizingFormsAndControls

Set the text property of form1 as MovingAndResizingFormsAndControls

Drag and drop a Button control on your form and set it name BtnMoveAndResize

Set the Text property of the button to Move And Resize as shwn in the Fig.vb-3.36

Double click the BtnMoveAndResize button and add the following code in the code window.

Private Sub BtnMoveAndResize_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnMoveAndResize.Click
Size = New Size(300, 200)
Location = New Point(0, 0)
BtnMoveAndResize.Size = New Size(60, 80)
BtnMoveAndResize.Location = New Point(20, 20)
End Sub

Dementions can also be set by using the setbounds Method. The argument passed to setBounds Method are as follows

Let us lean how we can resize forms and controls by continuing with the folowing steps:

Drag and drop a Button control and rename BtnsetDimention Then set the Text property Set Dimention

Double click the button control that you have just added to your form and add the following codes in the code window

Private Sub BtnSetDimentions_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSetDimentions.Click
SetBounds(10, 10, 400, 300)
BtnSetDimentions.SetBounds(0, 0, 50, 50)
End Sub
End Class

Run the appication by pressing th F5 key.

How to print Dialog

How to print Dialog

Create a new Windows application Form Here the name of the application is (Print Dialog )
Set the Text property of form1 as Print Dialog

Drag & Drop One Button Control, one PrinterDialog Control.and PrintDocument object from the Toolbox
Set the Name property of the button as BtnPrint the Text property as Print

Now, after setting the control property, Double Click on the print button and add the following code

Private Sub BtnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnPrint.Click
PrintDialog1.Document = PrintDocument1
PrintDialog1.PrinterSettings = PrintDocument1.PrinterSettings
PrintDialog1.AllowSomePages = True

If PrintDialog1.ShowDialog =Windows.Forms.DialogResult.OK Then
PrintDocument1.PrinterSettings = _PrintDocument1.PrinterSettings
PrintDocument1.Print()
End If
End Sub

Private Sub docprinting(ByVal sender As Object, _
ByVal e As System.Drawing.Printing.PrintPageEventArgs) _
Handles PrintDocument1.PrintPage
Dim str As String = "The quick brown dog Jumped over the lazy Fox."
Dim prnfont As New System.Drawing.Font _
("Arialr", 25, System.Drawing.FontStyle.Regular)
e.Graphics.DrawString(str, prnfont, System.Drawing.Brushes.Black, 20, 7)

End Sub
End Class


Press F5 key from the keyboad to run the applicatin
Click the print Button to print the Document

Friday, September 12, 2008

Registry edit Registry ඵක edit කරන්න පුරුදු වෙමු.

Registry ඵක edit කරන්න පුරුදු වෙමු.

කොහොමද Task Manager disable වෙලා තියෙනකොට Enable කරන්නනේ.
( For windows xp, NT,2003)


යන්න start ඵකට. Run click කරන්න. (regedit) ‍ටඊප් කරල Enter කරන්න.
යන්න
Hive: HKEY_CURRENT_USER
Key: Software\Microsoft\Windows\CurrentVersion\Policies\System
Name: DisableTaskMgr
Type: REG_DWORD
Value: 1=Enable Task Manager ඔනෙ නම් Disable කරන්න.
Value: 0=Disable Task Manager Enable කරන්න ඔනේ නම්.

Friday, August 29, 2008

Firefox


My choice for the windows is
FireFox.you all so can try it out.



How to fast FireFox

fist You type on FireFox address bar (about:config)
Then follow this setup

Network.http.max-connections ( change val into 50 )
Network.http.max-connections-per-server (16)
Network.http.max-persistent-connections-per-proxy (val into 9 or 8)
Network.http.max-persistent-connections-per-server ( val into 4 or 2)
Network.http.pipelining (true)
Network.http.pipelining.maxrequests (100)
Network.http.proxy.pipelining (true)

you use (firefox 2)


Network.http.request time out (300)

Browser.tab.showsingalwindofrfer (True)

Now you can Brows Net.
Enjoy!!!!!!!!!!!!!!
Good luck



Good Friend