<?xml version="1.0" encoding="UTF-8" standalone="no"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:gd="http://schemas.google.com/g/2005" xmlns:georss="http://www.georss.org/georss" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-15139945958479394</atom:id><lastBuildDate>Wed, 06 Nov 2024 03:04:57 +0000</lastBuildDate><category>Tutorial</category><category>Visual Basic 6.0</category><category>SQL</category><category>Software</category><category>VB.Net</category><category>Youtube</category><title>Ilmal Yakin Blog</title><description>Share and Continuously Learn</description><link>http://ilmalyakin.blogspot.com/</link><managingEditor>noreply@blogger.com (Ilmal Yakin)</managingEditor><generator>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><language>en-us</language><itunes:explicit>no</itunes:explicit><itunes:subtitle>Share and Continuously Learn</itunes:subtitle><itunes:owner><itunes:email>noreply@blogger.com</itunes:email></itunes:owner><item><guid isPermaLink="false">tag:blogger.com,1999:blog-15139945958479394.post-7104962509758143599</guid><pubDate>Wed, 11 Apr 2018 09:45:00 +0000</pubDate><atom:updated>2018-06-27T11:52:28.040+07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><category domain="http://www.blogger.com/atom/ns#">VB.Net</category><title>Array Function in VB.NET</title><description>&lt;div style="text-align: justify;"&gt;
Greating everyones, this time I will discuss about Array, what make Array so special, it's ability to store multiple value, other variable can only store one value&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFZsvFnnpwS8-WnUEOuNX_TvN2Cv5yqF-528xOC0r-zpbLx2AJ8AoSEAOGTs3ScJvMnejxze8MxB-yc2itxUkXX9YM62Iyb0D2ZylYdbYJjYtScyHjxS3y0Q1yduJzPPKltWBmoVcES4I/s1600/vs_logo.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" data-original-height="180" data-original-width="280" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFZsvFnnpwS8-WnUEOuNX_TvN2Cv5yqF-528xOC0r-zpbLx2AJ8AoSEAOGTs3ScJvMnejxze8MxB-yc2itxUkXX9YM62Iyb0D2ZylYdbYJjYtScyHjxS3y0Q1yduJzPPKltWBmoVcES4I/s1600/vs_logo.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;h3&gt;
Declaring One Dimensional Array&lt;/h3&gt;
&lt;pre class="brush:vbnet;"&gt;Dim arrValuesOne(9) As&amp;nbsp; Integer&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;'Create 10 slot with index start from 0 to 9

Dim arrValuesTwo(0 to 9) As Integer&amp;nbsp; &amp;nbsp;  'Also create 10 slot with index from 0 to 9&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
both code result same thing, to set the value of an array, refer to this code&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:vbnet;"&gt;arrValuesOne(0) = 1

arrValuesOne(1) = 2

arrValuesOne(2) = 3

arrValuesOne(3) = 4

arrValuesOne(4) = 5

arrValuesOne(5) = 6

arrValuesOne(6) = 7

arrValuesOne(7) = 8

arrValuesOne(8) = 9

arrValuesOne(9) = 10

&lt;/pre&gt;
&lt;br /&gt;
This is the simpliest way declare and set an array value&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Declaring Multi Dimensional&amp;nbsp;Array&lt;/h3&gt;
To create multi dimensional array, use the comma sign&lt;br /&gt;
&lt;pre class="brush:vbnet;"&gt;Dim arrValues(0 to 9, 0 to 9) As Decimal

&lt;/pre&gt;
&lt;br /&gt;
To set the value you can simply write it like this&lt;br /&gt;
&lt;pre class="brush:vbnet;"&gt;arrValues(0, 0) = 100

arrValues(1, 1) = 200

arrValues(2, 2) = 300

&lt;/pre&gt;
&lt;br /&gt;
and soon ...&lt;br /&gt;
&lt;br /&gt;
We can give in array as many as 32 dimensional, but in reality we only use 2 or 3&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
Declaring Array Without Initialized&lt;/h3&gt;
If we declare it like this&lt;br /&gt;
&lt;pre class="brush:vbnet;"&gt;Dim arrValues() As Integer

&lt;/pre&gt;
this means we declare an array without giving the slot, later if we want to give a slot, we can simply write it like this&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:vbnet;"&gt;Redim arrValues(0 to 10)

arrValues(1) = 1000

&lt;/pre&gt;
&lt;br /&gt;
To redim an array that already fill with value, and we don't want to reset the value, we can simply add Preserve keyworad infront of Redim&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:vbnet;"&gt;Redim Preserve arrValues(0 to 10)

&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style="color: blue;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;h3 style="text-align: center;"&gt;
&lt;b&gt;&lt;span style="color: blue;"&gt;&lt;b&gt;&lt;span style="color: blue;"&gt;Let's jump out to a sample code&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;
&lt;br /&gt;
&lt;br /&gt;
First create a sample form like this&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8OlKWC7WbyywezjGadXWqbFRQWhfqyd6NT_s3V7RrSOFJS4jxhH7sFTwd1TVzfOEZ7tT4utadmRNf_FA89jiEgRMg90Fe0ZgDcbJvHSsxPUYjpQNS8rUu68Y7mSUuSp4IuQO1ELT-x9w/s1600/Form1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" data-original-height="115" data-original-width="300" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8OlKWC7WbyywezjGadXWqbFRQWhfqyd6NT_s3V7RrSOFJS4jxhH7sFTwd1TVzfOEZ7tT4utadmRNf_FA89jiEgRMg90Fe0ZgDcbJvHSsxPUYjpQNS8rUu68Y7mSUuSp4IuQO1ELT-x9w/s1600/Form1.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;
In this form the user will input any kind of string and everytime the user hit the Add button the string value will be saved into the array&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
And if the user hit the Remove button the string value that already save into the array will be removed one by one according to the order&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:vbnet;"&gt;Public Class Form1
    ' The array of strings.
    Private Values(0 To -1) As String
 
    ' Add a string to the array.
    Private Sub btnAdd_Click(sender As Object, e As EventArgs) Handles btnAdd.Click
        ' Get the old upper bound.
        Dim old_upper_bound As Integer = Values.Length - 1
 
        ' Make room for the new item.
        ReDim Preserve Values(0 To old_upper_bound + 1)
 
        ' Insert the new item.
        Values(old_upper_bound + 1) = txtString.Text
 
        ' Clear the TextBox.
        txtString.Clear()
        txtString.Focus()
    End Sub
 
    ' Remove a string from the array.
    Private Sub btnRemove_Click(sender As Object, e As EventArgs) Handles btnRemove.Click
        ' Get the old upper bound.
        Dim old_upper_bound As Integer = Values.Length - 1
 
        ' Make sure the array isn't empty.
        If old_upper_bound &amp;lt; 0 Then
            ' There are no more items. Say so.
            txtString.Text = "&lt;no items="" more=""&gt;"
        Else
            ' Display the last item in the array.
            txtString.Text = Values(old_upper_bound)
 
            ' Resize the array to remove the last item.
            ReDim Preserve Values(0 To old_upper_bound - 1)
        End If
    End Sub
End Class
&lt;/no&gt;&lt;/pre&gt;
&lt;br /&gt;
Run the project, and try to add some item, after add several item, put a breakpoint in line 17, and hover the mouse over Values in line 14, you will see there are 4 item inside the Values array.&lt;br /&gt;
&lt;br /&gt;
Another great way to create an array and this is my favorite, after defining the array name, use curly bracketto fill the value&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:vbnet;"&gt;Dim TheValues As Integer = {10,23,350,324,500}&lt;/pre&gt;
&lt;br /&gt;
Of course you must give a value that correspond with the data type, otherwise it will be crashed.&lt;/div&gt;
</description><link>http://ilmalyakin.blogspot.com/2018/04/array-function-in-vbnet.html</link><author>noreply@blogger.com (Ilmal Yakin)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFZsvFnnpwS8-WnUEOuNX_TvN2Cv5yqF-528xOC0r-zpbLx2AJ8AoSEAOGTs3ScJvMnejxze8MxB-yc2itxUkXX9YM62Iyb0D2ZylYdbYJjYtScyHjxS3y0Q1yduJzPPKltWBmoVcES4I/s72-c/vs_logo.png" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-15139945958479394.post-974399046053330131</guid><pubDate>Tue, 08 Oct 2013 17:24:00 +0000</pubDate><atom:updated>2018-06-27T12:05:19.645+07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Software</category><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><category domain="http://www.blogger.com/atom/ns#">Visual Basic 6.0</category><title>Creat English Decimal Speller In Visual Basic 6.0</title><description>&lt;div style="text-align: justify;"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div style="text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
This function is almost the same as the previous post, but in the English version with little change in the coding.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;/div&gt;
Open the new project (Standard.Exe), in Form1 put 2 pieces of textbox with the default Name property (Text1 and Text2).&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhS49-RgB8t8-T58_2RvuETKY23Vs4X2mu8sVmcAzyCf0kO1UyeXkKgQvprE66LLFyUwr4aCER3z3bLvBD2qjVF-9dygF7fKrCBwe5DE-XuTljoKajpBRvnhMU0cqN-1rOLRepdVS7aQgQ/s1600/VB6_Logo.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" data-original-height="180" data-original-width="280" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhS49-RgB8t8-T58_2RvuETKY23Vs4X2mu8sVmcAzyCf0kO1UyeXkKgQvprE66LLFyUwr4aCER3z3bLvBD2qjVF-9dygF7fKrCBwe5DE-XuTljoKajpBRvnhMU0cqN-1rOLRepdVS7aQgQ/s1600/VB6_Logo.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Go to editor mode, click &lt;b&gt;View -&amp;gt; Code&lt;/b&gt;, and enter the following code :&lt;/div&gt;
&lt;br /&gt;
&lt;pre class="brush:vb;"&gt;Private Function SpellDigit(strNumeric As Integer)
&amp;nbsp;Dim cRet As String
&amp;nbsp;On Error GoTo Pesan
&amp;nbsp;cRet = ""
&amp;nbsp;Select Case strNumeric
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 0:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cRet = " zero"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 1:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cRet = " one"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 2:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cRet = " two"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 3:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cRet = " three"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 4:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cRet = " four"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 5:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cRet = " five"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 6:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cRet = " six"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 7:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cRet = " seven"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 8:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cRet = " eight"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 9:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cRet = " nine"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 10:&amp;nbsp;&amp;nbsp;&amp;nbsp; cRet = " ten"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 11:&amp;nbsp;&amp;nbsp;&amp;nbsp; cRet = " eleven"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 12:&amp;nbsp;&amp;nbsp;&amp;nbsp; cRet = " twelve"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 13:&amp;nbsp;&amp;nbsp;&amp;nbsp; cRet = " thirteen"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 14:&amp;nbsp;&amp;nbsp;&amp;nbsp; cRet = " fourteen"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 15:&amp;nbsp;&amp;nbsp;&amp;nbsp; cRet = " fifteen"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 16:&amp;nbsp;&amp;nbsp;&amp;nbsp; cRet = " sixteen"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 17:&amp;nbsp;&amp;nbsp;&amp;nbsp; cRet = " seventeen"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 18:&amp;nbsp;&amp;nbsp;&amp;nbsp; cRet = " eighteen"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 19:&amp;nbsp;&amp;nbsp;&amp;nbsp; cRet = " ninetieen"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 20:&amp;nbsp;&amp;nbsp;&amp;nbsp; cRet = " twenty"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 30:&amp;nbsp;&amp;nbsp;&amp;nbsp; cRet = " thirty"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 40:&amp;nbsp;&amp;nbsp;&amp;nbsp; cRet = " fourthy"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 50:&amp;nbsp;&amp;nbsp;&amp;nbsp; cRet = " fifty"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 60:&amp;nbsp;&amp;nbsp;&amp;nbsp; cRet = " sixty"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 70:&amp;nbsp;&amp;nbsp;&amp;nbsp; cRet = " seventy"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 80:&amp;nbsp;&amp;nbsp;&amp;nbsp; cRet = " eighty"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 90:&amp;nbsp;&amp;nbsp;&amp;nbsp; cRet = " ninety"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 100:&amp;nbsp;&amp;nbsp; cRet = " one hundred"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 200:&amp;nbsp;&amp;nbsp; cRet = " two hundred"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 300:&amp;nbsp;&amp;nbsp; cRet = " three hundred"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 400:&amp;nbsp;&amp;nbsp; cRet = " four hundred"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 500:&amp;nbsp;&amp;nbsp; cRet = " five hundred"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 600:&amp;nbsp;&amp;nbsp; cRet = " six hundred"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 700:&amp;nbsp;&amp;nbsp; cRet = " seven hundred"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 800:&amp;nbsp;&amp;nbsp; cRet = " eight hundred"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 900:&amp;nbsp;&amp;nbsp; cRet = " nine hundred"
&amp;nbsp;End Select
&amp;nbsp;SpellDigit = cRet
Exit Function

Pesan:
&amp;nbsp; SpellDigit = "(maksimal 9 digit)"
End Function
&lt;/pre&gt;
&lt;br /&gt;
&lt;pre class="brush:vb;"&gt;Private Function SpellUnit(strNumeric As Integer)
&amp;nbsp;Dim cRet As String
&amp;nbsp;Dim n100 As Integer
&amp;nbsp;Dim n10 As Integer
&amp;nbsp;Dim n1 As Integer
&amp;nbsp;On Error GoTo Pesan
&amp;nbsp;cRet = ""
&amp;nbsp;n100 = Int(strNumeric / 100) * 100
&amp;nbsp;n10 = Int((strNumeric - n100) / 10) * 10
&amp;nbsp;n1 = (strNumeric - n100 - n10)
&amp;nbsp;If n100 &amp;gt; 0 Then
&amp;nbsp;&amp;nbsp;&amp;nbsp; cRet = SpellDigit(n100)
&amp;nbsp;End If
&amp;nbsp;If n10 &amp;gt; 0 Then
&amp;nbsp;&amp;nbsp;&amp;nbsp; If n10 = 10 Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cRet = cRet &amp;amp; SpellDigit(n10 + n1)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cRet = cRet &amp;amp; SpellDigit(n10)
&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
&amp;nbsp;End If
&amp;nbsp;If n1 &amp;gt; 0 And n10 &amp;lt;&amp;gt; 10 Then
&amp;nbsp;&amp;nbsp;&amp;nbsp; cRet = cRet &amp;amp; SpellDigit(n1)
&amp;nbsp;End If
&amp;nbsp;SpellUnit = cRet
&amp;nbsp;Exit Function
Pesan:
&amp;nbsp; SpellUnit = "(maksimal 9 digit)"
End Function&lt;/pre&gt;
&lt;br /&gt;
&lt;pre class="brush:vb;"&gt;Public Function TerbilangInggris(strNumeric As String) As String
&amp;nbsp;Dim cRet As String
&amp;nbsp;Dim n1000000 As Long
&amp;nbsp;Dim n1000 As Long
&amp;nbsp;Dim n1 As Integer
&amp;nbsp;Dim n0 As Integer
&amp;nbsp;&amp;nbsp; On Error GoTo Pesan
&amp;nbsp;&amp;nbsp; Dim strValid As String, huruf As String * 1
&amp;nbsp;&amp;nbsp; Dim i As Integer
&amp;nbsp;&amp;nbsp; 'Periksa setiap karakter masukan
&amp;nbsp;&amp;nbsp; strValid = "1234567890.,"
&amp;nbsp;&amp;nbsp; For i% = 1 To Len(strNumeric)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; huruf = Chr(Asc(Mid(strNumeric, i%, 1)))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If InStr(strValid, huruf) = 0 Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox "Harus karakter angka!", _
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vbCritical, "Karakter Tidak Valid"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit Function
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
&amp;nbsp;&amp;nbsp; Next i%

&amp;nbsp;If strNumeric = "" Then Exit Function
&amp;nbsp;If Len(Trim(strNumeric)) &amp;gt; 9 Then GoTo Pesan

&amp;nbsp;cRet = ""
&amp;nbsp;n1000000 = Int(strNumeric / 1000000) * 1000000
&amp;nbsp;n1000 = Int((strNumeric - n1000000) / 1000) * 1000
&amp;nbsp;n1 = Int(strNumeric - n1000000 - n1000)
&amp;nbsp;n0 = (strNumeric - n1000000 - n1000 - n1) * 100
&amp;nbsp;If n1000000 &amp;gt; 0 Then
&amp;nbsp;&amp;nbsp;&amp;nbsp; cRet = SpellUnit(n1000000 / 1000000) &amp;amp; " million"
&amp;nbsp;End If
&amp;nbsp;If n1000 &amp;gt; 0 Then
&amp;nbsp;&amp;nbsp;&amp;nbsp; cRet = cRet &amp;amp; SpellUnit(n1000 / 1000) &amp;amp; " thousand"
&amp;nbsp;End If
&amp;nbsp;If n1 &amp;gt; 0 Then
&amp;nbsp;&amp;nbsp;&amp;nbsp; cRet = cRet &amp;amp; SpellUnit(n1)
&amp;nbsp;End If
&amp;nbsp;If n0 &amp;gt; 0 Then
&amp;nbsp;&amp;nbsp;&amp;nbsp; cRet = cRet &amp;amp; " and cents" &amp;amp; SpellUnit(n0)
&amp;nbsp;End If
&amp;nbsp;TerbilangInggris = cRet &amp;amp; " only"
&amp;nbsp;Exit Function

Pesan:
TerbilangInggris = "(maximum 9 digit)"
End Function&lt;/pre&gt;
&lt;br /&gt;
&lt;pre class="brush:vb;"&gt;Private Sub Text1_Change()
&amp;nbsp;&amp;nbsp;&amp;nbsp; Text2.Text = TerbilangInggris(Text1.Text)
End Sub&lt;/pre&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;
Run the project (Press F5), and enter the numeric value in the first textbox, and the resultant sentence in English will be displayed in the second textbox.&lt;br /&gt;
&lt;br /&gt;
Good luck.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.facebook.com/people/Ilmal-Yakin/1415120313"&gt;Be My Friend On Facebook&lt;/a&gt;&lt;/div&gt;
</description><link>http://ilmalyakin.blogspot.com/2013/10/membuat-fungsi-terbilang-desimal.html</link><author>noreply@blogger.com (Ilmal Yakin)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhS49-RgB8t8-T58_2RvuETKY23Vs4X2mu8sVmcAzyCf0kO1UyeXkKgQvprE66LLFyUwr4aCER3z3bLvBD2qjVF-9dygF7fKrCBwe5DE-XuTljoKajpBRvnhMU0cqN-1rOLRepdVS7aQgQ/s72-c/VB6_Logo.png" width="72"/><thr:total>4</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-15139945958479394.post-1772619354554844453</guid><pubDate>Thu, 25 Nov 2010 04:57:00 +0000</pubDate><atom:updated>2018-06-27T11:54:10.609+07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><category domain="http://www.blogger.com/atom/ns#">Visual Basic 6.0</category><title>Create Indonesia Decimal Speller Functions In Visual Basic 6.0</title><description>&lt;div style="text-align: justify;"&gt;
The following functions are one of the most commonly used functions for creating a project such as Sales and Inventory programs, as they usually need to generate transaction receipts.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Open a new project (Standard.Exe), in Form1 put 2 pieces of textbox for Name property leave with its default name.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyXkudGI5XPVKL2helcYhwXuIDs_Td184FvplWtouPGdAs8qGbaK2azAVrqi1WdSC9GdCq9bLKLnYT2UlGH4ij1R1CdT4wi3EWjZ_YXeq7yfLUkQDGuwEx6II9IpJc_98LCGqFQADES5U/s1600/VB6_Logo.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" data-original-height="180" data-original-width="280" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyXkudGI5XPVKL2helcYhwXuIDs_Td184FvplWtouPGdAs8qGbaK2azAVrqi1WdSC9GdCq9bLKLnYT2UlGH4ij1R1CdT4wi3EWjZ_YXeq7yfLUkQDGuwEx6II9IpJc_98LCGqFQADES5U/s1600/VB6_Logo.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Go to editor mode, click &lt;b&gt;View -&amp;gt; Code&lt;/b&gt;, and enter the following code :&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;pre class="brush:vb;"&gt;Public Function TerbilangDesimal(InputCurrency As String, Optional MataUang As String = "rupiah") As String
&amp;nbsp;Dim strInput As String
&amp;nbsp;Dim strBilangan As String
&amp;nbsp;Dim strPecahan As String
&amp;nbsp;&amp;nbsp; On Error GoTo Pesan
&amp;nbsp;&amp;nbsp; Dim strValid As String, huruf As String * 1
&amp;nbsp;&amp;nbsp; Dim i As Integer
&amp;nbsp;&amp;nbsp; 'Periksa setiap karakter yg diketikkan ke kotak
&amp;nbsp;&amp;nbsp; 'UserID
&amp;nbsp;&amp;nbsp; strValid = "1234567890,"
&amp;nbsp;&amp;nbsp; For i% = 1 To Len(InputCurrency)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; huruf = Chr(Asc(Mid(InputCurrency, i%, 1)))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If InStr(strValid, huruf) = 0 Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set AngkaTerbilang = Nothing
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox "Harus karakter angka!", _
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vbCritical, "Karakter Tidak Valid"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit Function
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
&amp;nbsp;&amp;nbsp; Next i%

&amp;nbsp;If InputCurrency = "" Then Exit Function
&amp;nbsp;If Len(Trim(InputCurrency)) &amp;gt; 15 Then GoTo Pesan

&amp;nbsp;strInput = CStr(InputCurrency) 'Konversi ke string
&amp;nbsp;'Periksa apakah ada tanda "," jika ya berarti pecahan
&amp;nbsp;If InStr(1, strInput, ",", vbBinaryCompare) Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp; strBilangan = Left(strInput, InStr(1, strInput, _
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ",", vbBinaryCompare) - 1)
&amp;nbsp; 'strBilangan = Right(strInput, InStr(1, strInput, _
&amp;nbsp; '&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ".", vbBinaryCompare) - 2)
&amp;nbsp; strPecahan = Trim(Right(strInput, Len(strInput) - Len(strBilangan) - 1))
&amp;nbsp; 
&amp;nbsp; If MataUang &amp;lt;&amp;gt; "" Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp; If CLng(Trim(strPecahan)) &amp;gt; 99 Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; strInput = Format(Round(CDbl(strInput), 2), "#0.00")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; strPecahan = Format((Right(strInput, Len(strInput) - Len(strBilangan) - 1)), "00")
&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; If Len(Trim(strPecahan)) = 1 Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; strInput = Format(Round(CDbl(strInput), 2), _
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "#0.00")
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; strPecahan = Format((Right(strInput, _
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Len(strInput) - Len(strBilangan) - 1)), "00")
&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; If CLng(Trim(strPecahan)) = 0 Then
&amp;nbsp;&amp;nbsp;&amp;nbsp; TerbilangDesimal = (KonversiBilangan(strBilangan) &amp;amp; MataUang &amp;amp; " " &amp;amp; KonversiBilangan(strPecahan))
&amp;nbsp;Else
&amp;nbsp; TerbilangDesimal = (KonversiBilangan(strBilangan) &amp;amp; MataUang &amp;amp; " " &amp;amp; KonversiBilangan(strPecahan) &amp;amp; "sen")
&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
&amp;nbsp; Else
&amp;nbsp;&amp;nbsp;&amp;nbsp; TerbilangDesimal = (KonversiBilangan(strBilangan) &amp;amp; "koma " &amp;amp; KonversiPecahan(strPecahan))
&amp;nbsp; End If
&amp;nbsp; 
&amp;nbsp;Else
&amp;nbsp;&amp;nbsp;&amp;nbsp; TerbilangDesimal = (KonversiBilangan(strInput))
&amp;nbsp; End If
&amp;nbsp;Exit Function
Pesan:
&amp;nbsp; TerbilangDesimal = "(maksimal 15 digit)"
End Function&lt;/pre&gt;
&lt;/div&gt;
&lt;pre class="brush:vb;"&gt;'Fungsi ini untuk mengkonversi nilai pecahan (setelah 'angka 0)
Private Function KonversiPecahan(strAngka As String) As String
Dim i%, strJmlHuruf$, Urai$, Kar$
&amp;nbsp;If strAngka = "" Then Exit Function
&amp;nbsp;&amp;nbsp;&amp;nbsp; strJmlHuruf = Trim(strAngka)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Urai = ""
&amp;nbsp;&amp;nbsp;&amp;nbsp; Kar = ""
&amp;nbsp;&amp;nbsp;&amp;nbsp; For i = 1 To Len(strJmlHuruf)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Tampung setiap satu karakter ke Kar
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Kar = Mid(strAngka, i, 1)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Urai = Urai &amp;amp; Kata(CInt(Kar))
&amp;nbsp;&amp;nbsp;&amp;nbsp; Next i
&amp;nbsp;&amp;nbsp;&amp;nbsp; KonversiPecahan = Urai
End Function&lt;/pre&gt;
&lt;pre class="brush:vb;"&gt;'Fungsi ini untuk menterjemahkan setiap satu angka ke 'kata
Private Function Kata(angka As Byte) As String
&amp;nbsp;&amp;nbsp; Select Case angka
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 1: Kata = "satu "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 2: Kata = "dua "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 3: Kata = "tiga "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 4: Kata = "empat "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 5: Kata = "lima "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 6: Kata = "enam "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 7: Kata = "tujuh "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 8: Kata = "delapan "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 9: Kata = "sembilan "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 0: Kata = "nol "
&amp;nbsp;&amp;nbsp; End Select
End Function&lt;/pre&gt;
&lt;pre class="brush:vb;"&gt;'Ini untuk mengkonversi nilai bilangan sebelum pecahan
Private Function KonversiBilangan(strAngka As String) As String
Dim strJmlHuruf$, intPecahan As Integer, strPecahan$, Urai$, Bil1$, strTot$, Bil2$
&amp;nbsp;Dim X, Y, z As Integer

&amp;nbsp;If strAngka = "" Then Exit Function
&amp;nbsp;&amp;nbsp;&amp;nbsp; strJmlHuruf = Trim(strAngka)
&amp;nbsp;&amp;nbsp;&amp;nbsp; X = 0
&amp;nbsp;&amp;nbsp;&amp;nbsp; Y = 0
&amp;nbsp;&amp;nbsp;&amp;nbsp; Urai = ""
&amp;nbsp;&amp;nbsp;&amp;nbsp; While (X &amp;lt; Len(strJmlHuruf))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; X = X + 1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; strTot = Mid(strJmlHuruf, X, 1)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Y = Y + Val(strTot)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; z = Len(strJmlHuruf) - X + 1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Select Case Val(strTot)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Case 0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '&amp;nbsp;&amp;nbsp; Bil1 = "NOL "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If (z = 1 Or z = 7 Or z = 10 Or z = 13) Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bil1 = "satu "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ElseIf (z = 4) Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If (X = 1) Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bil1 = "se"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bil1 = "satu "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ElseIf (z = 2 Or z = 5 Or z = 8 Or z = 11 Or z = 14) Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; X = X + 1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; strTot = Mid(strJmlHuruf, X, 1)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; z = Len(strJmlHuruf) - X + 1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bil2 = ""
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Select Case Val(strTot)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bil1 = "sepuluh "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bil1 = "sebelas "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 2
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bil1 = "dua belas "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 3
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bil1 = "tiga belas "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 4
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bil1 = "empat belas "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 5
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bil1 = "lima belas "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 6
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bil1 = "enam belas "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 7
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bil1 = "tujuh belas "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 8
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bil1 = "delapan belas "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 9
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bil1 = "sembilan belas "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Select
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bil1 = "se"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 2
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bil1 = "dua "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 3
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bil1 = "tiga "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 4
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bil1 = "empat "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 5
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bil1 = "lima "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 6
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bil1 = "enam "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 7
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bil1 = "tujuh "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 8
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bil1 = "delapan "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 9
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bil1 = "sembilan "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case Else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bil1 = ""
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Select
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If (Val(strTot) &amp;gt; 0) Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If (z = 2 Or z = 5 Or z = 8 Or z = 11 Or z = 14) Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bil2 = "puluh "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ElseIf (z = 3 Or z = 6 Or z = 9 Or z = 12 Or z = 15) Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bil2 = "ratus "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bil2 = ""
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bil2 = ""
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If (Y &amp;gt; 0) Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Select Case z
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 4
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bil2 = Bil2 + "ribu "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Y = 0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 7
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bil2 = Bil2 + "juta "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Y = 0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 10
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bil2 = Bil2 + "milyar "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Y = 0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case 13
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Bil2 = Bil2 + "trilyun "
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Y = 0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Select
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Urai = Urai + Bil1 + Bil2
&amp;nbsp; Wend
&amp;nbsp; KonversiBilangan = Urai
End Function&lt;/pre&gt;
&lt;pre class="brush:vb;"&gt;Private Sub Text1_Change()  'Isi besar nilai angka diulangi 'dengan terbilang huruf...
   Text2.Text = TerbilangDesimal(Text1.Text)
End Sub&lt;/pre&gt;
&lt;br /&gt;
Run the project (press F5) and try to enter some number of values into the first textbox, then the second textbox will generate a sentence counted from the number of numbers you enter.&lt;br /&gt;
&lt;br /&gt;
Good luck.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.facebook.com/people/Ilmal-Yakin/1415120313"&gt;Be My Friend On Facebook&lt;/a&gt;</description><link>http://ilmalyakin.blogspot.com/2010/11/membuat-fungsi-terbilang-desimal.html</link><author>noreply@blogger.com (Ilmal Yakin)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyXkudGI5XPVKL2helcYhwXuIDs_Td184FvplWtouPGdAs8qGbaK2azAVrqi1WdSC9GdCq9bLKLnYT2UlGH4ij1R1CdT4wi3EWjZ_YXeq7yfLUkQDGuwEx6II9IpJc_98LCGqFQADES5U/s72-c/VB6_Logo.png" width="72"/><thr:total>7</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-15139945958479394.post-3402505443906781233</guid><pubDate>Thu, 25 Nov 2010 04:07:00 +0000</pubDate><atom:updated>2018-06-27T11:54:24.610+07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><category domain="http://www.blogger.com/atom/ns#">Visual Basic 6.0</category><title>Create Initial Word into a Capitalized Letters In Visual Basic 6.0</title><description>&lt;div style="text-align: justify;"&gt;
for this post we will discuss a function that can change every initial letter on a word into uppercase or capslock.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;/div&gt;
Open a new project (Standard.Exe), in Form1 add a textbox and set the Height and Width property of a rather large size make sure your Multiline property is set to True, so that its textbox can be widened down, and let the Name property match its default name .&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyXkudGI5XPVKL2helcYhwXuIDs_Td184FvplWtouPGdAs8qGbaK2azAVrqi1WdSC9GdCq9bLKLnYT2UlGH4ij1R1CdT4wi3EWjZ_YXeq7yfLUkQDGuwEx6II9IpJc_98LCGqFQADES5U/s1600/VB6_Logo.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" data-original-height="180" data-original-width="280" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyXkudGI5XPVKL2helcYhwXuIDs_Td184FvplWtouPGdAs8qGbaK2azAVrqi1WdSC9GdCq9bLKLnYT2UlGH4ij1R1CdT4wi3EWjZ_YXeq7yfLUkQDGuwEx6II9IpJc_98LCGqFQADES5U/s1600/VB6_Logo.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;
Now let's move to editor mode, click &lt;b&gt;View -&amp;gt; Code&lt;/b&gt;, and enter the following code :&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;pre class="brush:vb;"&gt;Public Function AwalKataKapital(strKalimat As String)
Dim i As Integer
Dim Temp As String
Dim Lokasi As Integer
Dim huruf As String * 1
&amp;nbsp; Temp$ = ""
&amp;nbsp; For i% = 1 To Len(strKalimat)
&amp;nbsp;&amp;nbsp;&amp;nbsp; huruf = Chr(Asc(Mid(strKalimat, i%, 1)))
&amp;nbsp;&amp;nbsp;&amp;nbsp; If Len(Trim(huruf)) &amp;lt; 1 Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Lokasi% = i% + 1
&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
&amp;nbsp;&amp;nbsp;&amp;nbsp; If i% = Lokasi% Or i% = 1 Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Temp$ = Temp$ + UCase(Chr(Asc(Mid(strKalimat, _
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i%, 1))))
&amp;nbsp;&amp;nbsp;&amp;nbsp; Else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Temp$ = Temp$ + LCase(Chr(Asc(Mid(strKalimat, _
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i%, 1))))
&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
&amp;nbsp; Next i
&amp;nbsp; AwalKataKapital = Temp$
End Function&lt;/pre&gt;
&lt;pre class="brush:vb;"&gt;Private Sub Text1_Change()
&amp;nbsp; Dim posisi As Integer
&amp;nbsp; posisi = Text1.SelStart
&amp;nbsp; Text1.Text = AwalKataKapital(Text1.Text)
&amp;nbsp; Text1.SelStart = posisi
End Sub&lt;/pre&gt;
&lt;pre class="brush:vb;"&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Press F5 to run the project, you try to type some words in the textbox we have provided, then every letter of the beginning of the word will automatically turn into capital letters.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Good luck.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;a href="http://www.facebook.com/people/Ilmal-Yakin/1415120313"&gt;Be My Friend On Facebook&lt;/a&gt;&lt;/div&gt;
</description><link>http://ilmalyakin.blogspot.com/2010/11/membuat-fungsi-awal-kata-menjadi-huruf.html</link><author>noreply@blogger.com (Ilmal Yakin)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyXkudGI5XPVKL2helcYhwXuIDs_Td184FvplWtouPGdAs8qGbaK2azAVrqi1WdSC9GdCq9bLKLnYT2UlGH4ij1R1CdT4wi3EWjZ_YXeq7yfLUkQDGuwEx6II9IpJc_98LCGqFQADES5U/s72-c/VB6_Logo.png" width="72"/><thr:total>3</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-15139945958479394.post-2273832218669080092</guid><pubDate>Thu, 16 Sep 2010 10:20:00 +0000</pubDate><atom:updated>2018-06-27T12:06:41.550+07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><category domain="http://www.blogger.com/atom/ns#">Visual Basic 6.0</category><category domain="http://www.blogger.com/atom/ns#">Youtube</category><title>Remove a Title Bar or None BorderStyle On MDI Form</title><description>&lt;div style="text-align: justify;"&gt;
Sometime we want to manipulate the entire screen appearance, without having to be limited by the title bar or status bar, if that's what you want, refer to the following reviews&lt;br /&gt;
&lt;br /&gt;
On the reguler form this is very easy to do, we only have to set the property BorderStyle = 0 - None, but to remove Title Bar on MDI Form we need to call some API function.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyXkudGI5XPVKL2helcYhwXuIDs_Td184FvplWtouPGdAs8qGbaK2azAVrqi1WdSC9GdCq9bLKLnYT2UlGH4ij1R1CdT4wi3EWjZ_YXeq7yfLUkQDGuwEx6II9IpJc_98LCGqFQADES5U/s1600/VB6_Logo.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" data-original-height="180" data-original-width="280" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyXkudGI5XPVKL2helcYhwXuIDs_Td184FvplWtouPGdAs8qGbaK2azAVrqi1WdSC9GdCq9bLKLnYT2UlGH4ij1R1CdT4wi3EWjZ_YXeq7yfLUkQDGuwEx6II9IpJc_98LCGqFQADES5U/s1600/VB6_Logo.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Add an MDI Form to the project via &lt;b&gt;Project -&amp;gt; Add MDI Form&lt;/b&gt;, and a Module from the menu &lt;b&gt;Project -&amp;gt; Add Module&lt;/b&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Double klik Module1, and type in the following code :&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class="brush:vb;"&gt;Private Declare Function GetWindowLong Lib "USER32" Alias _
"GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "USER32" Alias _
"SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long

Private Const GWL_STYLE = (-16)
Private Const WS_BORDER = &amp;amp;H800000
Private Const WS_CAPTION = &amp;amp;HC00000

Public Sub MDINoBorder(ByRef nFormHWND As Long)
Dim sHandle As Long
On Error GoTo errMDINoBorder

sHandle = GetWindowLong(nFormHWND, GWL_STYLE)
sHandle = sHandle And Not WS_CAPTION
SetWindowLong nFormHWND, GWL_STYLE, sHandle

Exit Sub

errMDINoBorder:
  MsgBox "[" &amp;amp; Err.Number &amp;amp; "] - " &amp;amp; Err.Description, _
  vbExclamation, "MDI No Border Error"
End Sub
&lt;/pre&gt;
&lt;br /&gt;
And then double click the MDIForm1, and type in the following code :&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:vb;"&gt;Private Sub MDIForm_Activate()
  MDINoBorder Me.hwnd
End Sub
&lt;/pre&gt;
&lt;br /&gt;
Run the project by pressing the F5 key, and see the result now MDIForm on your project does not have a Title Bar.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaDxvh-YCSg8wBSbFp9xkvucfcjePtBrub2Yq3p5qHivcRfrnhGbeJuQpYQTcG7ILeha_RbXw69u0A2p51lwGzGDolBZbQtHKDGKqVONOj5muLFWh6vGeIFN11IZpzFX68xukAJuJ0ptE/s1600/Ilustrasi1.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiaDxvh-YCSg8wBSbFp9xkvucfcjePtBrub2Yq3p5qHivcRfrnhGbeJuQpYQTcG7ILeha_RbXw69u0A2p51lwGzGDolBZbQtHKDGKqVONOj5muLFWh6vGeIFN11IZpzFX68xukAJuJ0ptE/s320/Ilustrasi1.gif" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Good luck.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.facebook.com/people/Ilmal-Yakin/1415120313"&gt;Be My Friend On Facebook&lt;/a&gt;</description><link>http://ilmalyakin.blogspot.com/2010/09/cara-menghilangkan-title-bar-atau-none.html</link><author>noreply@blogger.com (Ilmal Yakin)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyXkudGI5XPVKL2helcYhwXuIDs_Td184FvplWtouPGdAs8qGbaK2azAVrqi1WdSC9GdCq9bLKLnYT2UlGH4ij1R1CdT4wi3EWjZ_YXeq7yfLUkQDGuwEx6II9IpJc_98LCGqFQADES5U/s72-c/VB6_Logo.png" width="72"/><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-15139945958479394.post-1596792327484510865</guid><pubDate>Tue, 24 Aug 2010 04:08:00 +0000</pubDate><atom:updated>2018-06-27T11:54:52.163+07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><category domain="http://www.blogger.com/atom/ns#">Visual Basic 6.0</category><title>Handling Files and Directories In Visual Basic 6.0</title><description>&lt;div style="text-align: justify;"&gt;
Sometimes we need to interact with files and directories that exist on the hard drive, for example if we want to export existing data into MS. Excel files, or maybe you want can to restore its database from backup results that have been made before&lt;br /&gt;
&lt;br /&gt;
Here are some examples of code that can handle file and directory issues&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyXkudGI5XPVKL2helcYhwXuIDs_Td184FvplWtouPGdAs8qGbaK2azAVrqi1WdSC9GdCq9bLKLnYT2UlGH4ij1R1CdT4wi3EWjZ_YXeq7yfLUkQDGuwEx6II9IpJc_98LCGqFQADES5U/s1600/VB6_Logo.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" data-original-height="180" data-original-width="280" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyXkudGI5XPVKL2helcYhwXuIDs_Td184FvplWtouPGdAs8qGbaK2azAVrqi1WdSC9GdCq9bLKLnYT2UlGH4ij1R1CdT4wi3EWjZ_YXeq7yfLUkQDGuwEx6II9IpJc_98LCGqFQADES5U/s1600/VB6_Logo.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;T&amp;amp;T#1) CHECK FILE PROPERTIES&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Open the new Standard.Exe project, place 1 CommandButton and change its caption to Properties, double click commandbutton and insert the following code:&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class="brush:vb;"&gt;Private Sub Command1_Click()
  'Ganti 'c:\autoexec.bat' dengan nama file yang Anda
  'ingin lihat kotak dialog property-nya...
  Call ShowProps("c:\autoexec.bat", Me.hwnd)
End Sub

Public Sub ShowProps(FileName As String, OwnerhWnd _
As Long)
Dim SEI As SHELLEXECUTEINFO
Dim r As Long
With SEI
  .cbSize = Len(SEI)
  .fMask = SEE_MASK_NOCLOSEPROCESS Or _
  SEE_MASK_INVOKEIDLIST Or SEE_MASK_FLAG_NO_UI
  .hwnd = OwnerhWnd
  .lpVerb = "properties"
  .lpFile = FileName
  .lpParameters = vbNullChar
  .lpDirectory = vbNullChar
  .nShow = 0
  .hInstApp = 0
  .lpIDList = 0
End With
r = ShellExecuteEX(SEI)
End Sub
&lt;/pre&gt;
&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;
Click&amp;nbsp;&lt;b&gt;Project -&amp;gt; Add Module&lt;/b&gt;, double click module1 and enter the following code :&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;/div&gt;
&lt;pre class="brush:vb;"&gt;Type SHELLEXECUTEINFO
  cbSize As Long
  fMask As Long
  hwnd As Long
  lpVerb As String
  lpFile As String
  lpParameters As String
  lpDirectory As String
  nShow As Long
  hInstApp As Long
  lpIDList As Long
  lpClass As String
  hkeyClass As Long
  dwHotKey As Long
  hIcon As Long
  hProcess As Long
End Type

Public Const SEE_MASK_INVOKEIDLIST = &amp;amp;HC
Public Const SEE_MASK_NOCLOSEPROCESS = &amp;amp;H40
Public Const SEE_MASK_FLAG_NO_UI = &amp;amp;H400
Declare Function ShellExecuteEX Lib "shell32.dll" Alias _
"ShellExecuteEx" (SEI As SHELLEXECUTEINFO) As Long
&lt;/pre&gt;
&lt;br /&gt;
Press&amp;nbsp;&lt;b&gt;F5&lt;/b&gt; and run the project
&lt;br /&gt;
&lt;br /&gt;
Click the Properties button, it will display the properties of the autoexec.bat file that we use as an example&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;T&amp;amp;T#2) CREATE EXCEL FILE&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Open the new Standard.Exe project, insert 1 CommandButton into the form, double click commandbutton and enter the following code:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:vb;"&gt;Private Sub Command1_Click()
Dim xlApp As Excel.Application
Dim xlWB As Excel.Workbook
Dim xlWS As Excel.Worksheet

Set xlApp = New Excel.Application
Set xlWB = xlApp.Workbooks.Add
Set xlWS = xlWB.Worksheets.Add

'this line will fill cell (2,2) with
'text "hello" and fill cell (1,3) with
'text "World"

xlWS.Cells(2, 2).Value = "hello"
xlWS.Cells(1, 3).Value = "World"

'This line will save the spreadsheet into
'file "c:\mysheet.xls".

xlWS.SaveAs "c:\mysheet.xls"
xlApp.Quit

'free some memory...

Set xlWS = Nothing
Set xlWB = Nothing
Set xlApp = Nothing
End Sub
&lt;/pre&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt; &lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Press&amp;nbsp;&lt;b&gt;F5&lt;/b&gt; and run the project
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;T&amp;amp;T#3) OPEN THE DIALOGUE BOX “BROWSE FOR FOLDER”&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;
Open the new Standard.Exe project, insert 1 CommandButton into the form, and change the caption to Browse, double click commandbutton, and enter the following code:&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class="brush:vb;"&gt;Private Sub Command1_Click()
Dim lpIDList As Long
Dim sBuffer As String
Dim szTitle As String
Dim tBrowseInfo As BrowseInfo

'Change the "Browse For Folders" dialogue title

szTitle = "This Is My Title"
With tBrowseInfo
&amp;nbsp; .hWndOwner = Me.hWnd
&amp;nbsp; .lpszTitle = lstrcat(szTitle, "")
&amp;nbsp; .ulFlags = BIF_RETURNONLYFSDIRS + _
&amp;nbsp; BIF_DONTGOBELOWDOMAIN
End With

lpIDList = SHBrowseForFolder(tBrowseInfo)
If (lpIDList) Then
sBuffer = Space(MAX_PATH)
SHGetPathFromIDList lpIDList, sBuffer

'sBuffer var is the selected directory choose by user.

sBuffer = Left(sBuffer, InStr(sBuffer, _
vbNullChar) - 1)

MsgBox sBuffer
End If
End Sub
&lt;/pre&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;
Last but not least click&amp;nbsp;&lt;b&gt;Project -&amp;gt; Add Module&lt;/b&gt;, double click Module1, and enter the following code:&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class="brush:vb;"&gt;Public Const BIF_RETURNONLYFSDIRS = 1
Public Const BIF_DONTGOBELOWDOMAIN = 2
Public Const MAX_PATH = 260
Declare Function SHBrowseForFolder Lib _
"shell32" (lpbi As BrowseInfo) As Long
Declare Function SHGetPathFromIDList Lib "shell32" _
(ByVal pidList As Long, ByVal lpBuffer As String) As Long
Declare Function lstrcat Lib "kernel32" _
Alias "lstrcatA" (ByVal lpString1 As String, ByVal _
lpString2 As String) As Long

Public Type BrowseInfo
&amp;nbsp;&amp;nbsp; hWndOwner As Long
&amp;nbsp;&amp;nbsp; pIDLRoot As Long
&amp;nbsp;&amp;nbsp; pszDisplayName As Long
&amp;nbsp;&amp;nbsp; lpszTitle As Long
&amp;nbsp;&amp;nbsp;  ulFlags As Long
&amp;nbsp;&amp;nbsp;  lpfnCallback As Long
&amp;nbsp;&amp;nbsp;  lParam As Long
&amp;nbsp;&amp;nbsp;  iImage As Long
End Type
&lt;/pre&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;
Press&amp;nbsp;&lt;b&gt;F5&lt;/b&gt; and run the project
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;T&amp;amp;T#4) OPEN WINDOWS EXPLORER WITH SPECIFIC DIREKTORY&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;
Open the new Standard.Exe project, insert 1 CommandButton into the form, double click commandbutton, and enter the following code:&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;/div&gt;
&lt;pre class="brush:vb;"&gt;Private Sub Command1_Click()
'specify the directory name that you will be open with Windows Explorer
&amp;nbsp;&amp;nbsp; OpenExplorer ("C:\Program Files\")
End Sub

Public Sub OpenExplorer(Optional InitialDirectory As String)
&amp;nbsp;&amp;nbsp;   ShellExecute 0, "Explore", InitialDirectory, vbNullString, _
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vbNullString, SW_SHOWNORMAL
End Sub
&lt;/pre&gt;
&lt;div style="text-align: justify;"&gt;
&lt;div style="text-align: justify;"&gt;
Click&amp;nbsp;&lt;b&gt;Project -&amp;gt; Add Module&lt;/b&gt;, double klik Module1, and enter the following code :&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;/div&gt;
&lt;pre class="brush:vb;"&gt;Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal _
lpOperation As String, ByVal lpFile As String, ByVal _
lpParameters As String, ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Public Const SW_SHOWNORMAL = 1
&lt;/pre&gt;
&lt;div style="text-align: justify;"&gt;
Press&amp;nbsp;&lt;b&gt;F5&lt;/b&gt; and run the project
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;T&amp;amp;T#5) CHECK IF&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;DIRECTORY EXIST&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;
Open the new Standard.Exe project, double click Form1 and enter the following code:&lt;br /&gt;
'The example of the checked directory is "C: \ Windows"&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:vb;"&gt;Private Sub Form_Load()
Const ATTR_DIRECTORY = 16
If Dir$("c:\windows", ATTR_DIRECTORY) &amp;lt;&amp;gt; "" Then
MsgBox "Direktori ada!", vbInformation, "Ada"
Else MsgBox "Directory does not exist!", vbCritical, "Not Found" 
End If 
End Sub 
&lt;/pre&gt;
&lt;br /&gt;
Press&amp;nbsp;&lt;b&gt;F5&lt;/b&gt; and run the project&lt;/div&gt;
&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;T&amp;amp;T#6) CHECK IF FILE EXIST&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Open the new Standard.Exe project, double click Form1 and enter the following code:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:vb;"&gt;'Example file"C:\autoexec.bat"
Private Sub Form_Load()
'Change "c:\autoexec.bat" with the complete file name (include the path)

If Dir$("c:\autoexec.bat") &amp;lt;&amp;gt; "" Then
&amp;nbsp;&amp;nbsp; MsgBox "File Exist!", vbInformation, "Exist"
Else
&amp;nbsp;&amp;nbsp; MsgBox "File Not Found!", vbCritical, "Not Found"
End If
End Sub
&lt;/pre&gt;
&lt;br /&gt;
Press &lt;b&gt;F5&lt;/b&gt; and run the project
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;T&amp;amp;T#7) MOVING FILE&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Open the new Standard.Exe project, insert 1 CommandButton into the form, double click commandbutton, and enter the following code:&lt;br /&gt;
&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;
&lt;/div&gt;
&lt;pre class="brush:vb;"&gt;'this will move file 'c:\MyFile.Zip' to 'direktori 'c:\MyDir'.
Private Sub Command1_Click()
A = MoveFile("c:\MyFile.Zip", "c:\MyDir\MyFile.Zip")
If A Then
&amp;nbsp;&amp;nbsp;     MsgBox "File successfully move!", _
&amp;nbsp;&amp;nbsp;            vbInformation, "Sukses Pindah File"
Else
&amp;nbsp;&amp;nbsp;     MsgBox "Error. Can not move file!" &amp;amp; Chr(13) &amp;amp; _
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Maybe file does not exist" &amp;amp; _
&amp;nbsp;&amp;nbsp;            Chr(13) &amp;amp; "or file already exist in " &amp;amp; _
&amp;nbsp;&amp;nbsp;            Chr(13) &amp;amp; _
&amp;nbsp;&amp;nbsp;            "destination folder!", vbCritical, "Error: Moving File"
End If
End Sub
&lt;/pre&gt;
&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;
Click&amp;nbsp;&lt;b&gt;Project -&amp;gt; Add Module&lt;/b&gt;, double click Module1, and enter the following code :&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;pre class="brush:vb;"&gt;Declare Function MoveFile Lib "kernel32" Alias "MoveFileA" _ 
(ByVal lpExistingFileName As String, ByVal lpNewFileName As String) _
As Long
&lt;/pre&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;
Press&amp;nbsp;&lt;b&gt;F5&lt;/b&gt; and run the project
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;T&amp;amp;T#8) GET FILE NAME&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Open the new Standard.Exe project, double click Form1 and enter the following code:&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;/div&gt;
&lt;pre class="brush:vb;"&gt;Private Sub Form_Load()
   MsgBox StripPath("c:\myfolder\myfile.exe") 
End Sub

Function StripPath(T$) As String
Dim x%, ct%
StripPath$ = T$
x% = InStr(T$, "\")
Do While x%
&amp;nbsp; ct% = x%
&amp;nbsp; x% = InStr(ct% + 1, T$, "\")
Loop
If ct% &amp;gt; 0 Then StripPath$ = Mid$(T$, ct% + 1)
End Function
&lt;/pre&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;
Press&amp;nbsp;&lt;b&gt;F5&lt;/b&gt; and run the project
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;T&amp;amp;T#9) GET FILE EXTENSION&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Open the new Standard.Exe project, double click Form1 and enter the following code:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:vb;"&gt;Private Sub Form_Load()
&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox GetExtension("c:\myfolder\myfile.exe")
End Sub

Function GetExtension(FileName As String)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim PthPos, ExtPos As Integer
&amp;nbsp;&amp;nbsp;&amp;nbsp; For i = Len(FileName) To 1 Step -1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Mid(FileName, i, 1) = "." Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ExtPos = i
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For j = Len(FileName) To 1 Step -1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Mid(FileName, j, 1) = "\" Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PthPos = j
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit For
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next j
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit For
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
&amp;nbsp;&amp;nbsp;&amp;nbsp; Next i
&amp;nbsp;&amp;nbsp;&amp;nbsp; If PthPos &amp;gt; ExtPos Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit Function
&amp;nbsp;&amp;nbsp;&amp;nbsp; Else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If ExtPos = 0 Then Exit Function
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GetExtension = Mid(FileName, ExtPos + 1, _
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Len(FileName) - ExtPos)
&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
End Function
&lt;/pre&gt;
Press&amp;nbsp;&lt;b&gt;F5&lt;/b&gt; and run the project&lt;/div&gt;
&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;T&amp;amp;T#10) GET DIRECTORY SIZE&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Open the new Standard.Exe project, insert 1 CommandButton into the form, double click commandbutton, and enter the following code:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:vb;"&gt;Private Sub Command1_Click()
&amp;nbsp; MsgBox "Directory Size C:\Windows = " &amp;amp; _
&amp;nbsp; Format(SizeOf("C:\Windows"), "#,#") &amp;amp; _
&amp;nbsp; " bytes", vbInformation, "Directory Size"
End Sub

Public Function SizeOf(ByVal DirPath As String) As Double
Dim hFind As Long
Dim fdata As WIN32_FIND_DATA
Dim dblSize As Double
Dim sName As String
Dim x As Long
On Error Resume Next
&amp;nbsp; x = GetAttr(DirPath)
&amp;nbsp; If Err Then SizeOf = 0: Exit Function
&amp;nbsp; If (x And vbDirectory) = vbDirectory Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dblSize = 0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Err.Clear
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sName = Dir$(EndSlash(DirPath) &amp;amp; "*.*", vbSystem _
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Or vbHidden Or vbDirectory)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Err.Number = 0 Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hFind = FindFirstFile(EndSlash(DirPath) &amp;amp; _
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "*.*", fdata)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If hFind = 0 Then Exit Function
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Do
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If (fdata.dwFileAttributes And vbDirectory) = _
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vbDirectory Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sName = Left$(fdata.cFileName, _
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; InStr(fdata.cFileName, vbNullChar) - 1)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If sName &amp;lt;&amp;gt; "." And sName &amp;lt;&amp;gt; ".." Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dblSize = dblSize + _
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SizeOf(EndSlash(DirPath) &amp;amp; sName)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dblSize = dblSize + fdata.nFileSizeHigh * _
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 65536 + fdata.nFileSizeLow
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DoEvents
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Loop While FindNextFile(hFind, fdata) &amp;lt;&amp;gt; 0
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hFind = FindClose(hFind)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If
&amp;nbsp; Else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; On Error Resume Next
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dblSize = FileLen(DirPath)
&amp;nbsp; End If
&amp;nbsp; SizeOf = dblSize
End Function

Private Function EndSlash(ByVal PathIn As String) As String
&amp;nbsp; If Right$(PathIn, 1) = "\" Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EndSlash = PathIn
&amp;nbsp; Else
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EndSlash = PathIn &amp;amp; "\"
&amp;nbsp; End If
End Function
&lt;/pre&gt;
&lt;br /&gt;
Click&amp;nbsp;&lt;b&gt;Project -&amp;gt; Add Module&lt;/b&gt;, double klik Module1 and enter the following code :&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:vb;"&gt;Public Const MAX_PATH = 260
Public Type FILETIME
&amp;nbsp; dwLowDateTime As Long
&amp;nbsp; dwHighDateTime As Long
End Type

Public Type WIN32_FIND_DATA
&amp;nbsp; dwFileAttributes As Long
&amp;nbsp; ftCreationTime As FILETIME
&amp;nbsp; ftLastAccessTime As FILETIME
&amp;nbsp; ftLastWriteTime As FILETIME
&amp;nbsp; nFileSizeHigh As Long
&amp;nbsp; nFileSizeLow As Long
&amp;nbsp; dwReserved0 As Long
&amp;nbsp; dwReserved1 As Long
&amp;nbsp; cFileName As String * MAX_PATH
&amp;nbsp; cAlternate As String * 14
End Type

Declare Function FindFirstFile Lib "kernel32" _
Alias "FindFirstFileA" (ByVal lpFileName As String, _
lpFindFileData As WIN32_FIND_DATA) As Long
&amp;nbsp; 
Declare Function FindNextFile Lib "kernel32" _
Alias "FindNextFileA" (ByVal hFindFile As Long, _
lpFindFileData As WIN32_FIND_DATA) As Long
&amp;nbsp; 
Declare Function FindClose Lib "kernel32" _
(ByVal hFindFile As Long) As Long
&lt;/pre&gt;
&lt;br /&gt;
Press&amp;nbsp;&lt;b&gt;F5&lt;/b&gt; and run the project&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;T&amp;amp;T#11) DELETE FILE TO RECYCLE BIN&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Open the new Standard.Exe project, insert 1 CommandButton into the form, double click commandbutton, and enter the following code:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:vb;"&gt;Private Sub Command1_Click()
Dim MyBool As Boolean
&amp;nbsp; DelToRecycBin ("c:\My Documents\MyFile.Zip")
End Sub

Public Function DelToRecycBin(FileName As String)
Dim FileOperation As SHFILEOPSTRUCT
Dim lReturn As Long
On Error GoTo DelToRecycBin_Err
&amp;nbsp; With FileOperation
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .wFunc = F0_DELETE
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .pFrom = FileName
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .fFlags = F0F_ALLOWUNDO + F0F_CREATEPROGRESSDLG
&amp;nbsp; End With
&amp;nbsp; lReturn = SHFileOperation(FileOperation)
&amp;nbsp; Exit Function
DelToRecycBin_Err:
&amp;nbsp; MsgBox Err.Number &amp;amp; Err.Description
End Function
&lt;/pre&gt;
&lt;br /&gt;
Click&amp;nbsp;&lt;b&gt;Project -&amp;gt; Add Module&lt;/b&gt;, double klik Module1, and enter the following code :&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:vb;"&gt;'Depend on your windows setting if you disable delete to recycle bin
'file akan will be deleted permanently

Public Type SHFILEOPSTRUCT
hwnd As Long
wFunc As Long
pFrom As String
pTo As String
fFlags As Integer
fAnyOperationsAborted As Boolean
hNameMappings As Long
lpszProgressTitle As String
End Type
Declare Function SHFileOperation Lib "shell32.dll" _
Alias "SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long
Public Const F0_DELETE = &amp;amp;H3
Public Const F0F_ALLOWUNDO = &amp;amp;H40
Public Const F0F_CREATEPROGRESSDLG As Long = &amp;amp;H0
&lt;/pre&gt;
&lt;br /&gt;
Press&amp;nbsp;&lt;b&gt;F5&lt;/b&gt; and run the project&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Good luck.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.facebook.com/people/Ilmal-Yakin/1415120313"&gt;Be My Friend On Facebook&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;/div&gt;
&lt;/div&gt;
</description><link>http://ilmalyakin.blogspot.com/2010/08/tips-dan-trik-penanganan-file-dan.html</link><author>noreply@blogger.com (Ilmal Yakin)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyXkudGI5XPVKL2helcYhwXuIDs_Td184FvplWtouPGdAs8qGbaK2azAVrqi1WdSC9GdCq9bLKLnYT2UlGH4ij1R1CdT4wi3EWjZ_YXeq7yfLUkQDGuwEx6II9IpJc_98LCGqFQADES5U/s72-c/VB6_Logo.png" width="72"/><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-15139945958479394.post-1175707016403903168</guid><pubDate>Wed, 11 Aug 2010 08:29:00 +0000</pubDate><atom:updated>2018-06-27T11:55:02.479+07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><category domain="http://www.blogger.com/atom/ns#">Visual Basic 6.0</category><title>Handling TextBox In Visual Basic 6.0</title><description>&lt;div style="text-align: justify;"&gt;
&lt;b&gt;TextBox&lt;/b&gt;&amp;nbsp;is one of the most important components in the visual-based programming environment, because this component will accept the data input from the user, the lack of attention to this component will be very fatal, ranging from Runtime Error to Invalid data and others.&lt;/div&gt;
&lt;br /&gt;
Here are some tips and tricks in handling textbox :&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyXkudGI5XPVKL2helcYhwXuIDs_Td184FvplWtouPGdAs8qGbaK2azAVrqi1WdSC9GdCq9bLKLnYT2UlGH4ij1R1CdT4wi3EWjZ_YXeq7yfLUkQDGuwEx6II9IpJc_98LCGqFQADES5U/s1600/VB6_Logo.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" data-original-height="180" data-original-width="280" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyXkudGI5XPVKL2helcYhwXuIDs_Td184FvplWtouPGdAs8qGbaK2azAVrqi1WdSC9GdCq9bLKLnYT2UlGH4ij1R1CdT4wi3EWjZ_YXeq7yfLUkQDGuwEx6II9IpJc_98LCGqFQADES5U/s1600/VB6_Logo.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;T&amp;amp;T#1) ONLY ACCPET NUMERIC VALUE&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
For the demo please open a new project, select standard exe, then place a textbox for experiment material and set with the following properties:&lt;br /&gt;
&lt;br /&gt;
Name : Text1&lt;br /&gt;
Text : (clear)&lt;br /&gt;
&lt;br /&gt;
Then press F7 to switch to view code mode, or through the View -&amp;gt; Code menu, then type in the following code :&lt;br /&gt;
&lt;pre class="brush:vb;"&gt;Private Sub Text1_KeyPress(KeyAscii As Integer)
&amp;nbsp;&amp;nbsp;&amp;nbsp; If Not (KeyAscii &amp;gt;= Asc("0") &amp;amp; Chr(13) _
&amp;nbsp;&amp;nbsp;&amp;nbsp; And KeyAscii &amp;lt;= Asc("9") &amp;amp; Chr(13) _
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Or KeyAscii = vbKeyBack _
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Or KeyAscii = vbKeyDelete _
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Or KeyAscii = vbKeySpace) Then
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Beep
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; KeyAscii = 0
&amp;nbsp;&amp;nbsp; End If
End Sub 
&lt;/pre&gt;
&lt;i&gt;Press F5, and see the result&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Based on the above code then the data that we entry into the textbox only receive numerical data, and some other key like BackSpace, Delete and Space.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;T&amp;amp;T#2)&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;&amp;nbsp;ONLY ACCPET UPPER CASE ENTRY INTO THE TEXTBOX&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Open the new project Standard Exe, then place 2 pieces of textbox with the following properties :&lt;br /&gt;
Name : Text1&lt;br /&gt;
Text : (empty)&lt;br /&gt;
&lt;br /&gt;
Name : Text2&lt;br /&gt;
Text : (empty)&lt;br /&gt;
&lt;br /&gt;
Press F7, or select View -&amp;gt; Code, then type the following code :&lt;br /&gt;
&lt;pre class="brush:vb;"&gt;Private Sub Text1_Change()
'Text1 menggunakan event Change
Dim posisi As Integer
&amp;nbsp;&amp;nbsp;&amp;nbsp; posisi = Text1.SelStart
&amp;nbsp;&amp;nbsp;&amp;nbsp; Text1.Text = UCase(Text1.Text)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Text1.SelStart = posisi
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
'Text2 menggunakan event KeyPress
&amp;nbsp;&amp;nbsp;&amp;nbsp; KeyAscii = Asc(UCase(Chr(KeyAscii)))
End Sub 
&lt;/pre&gt;
&lt;i&gt;Press F5 and see the result&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;T&amp;amp;T#3)&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;&amp;nbsp;ONLY ACCEPT LOWER CASE ENTRY INTO THE TEXTBOX&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Open the new project Standard Exe, then place 2&amp;nbsp; textbox with the following properties :&lt;br /&gt;
Name : Text1&lt;br /&gt;
Text : (empty)&lt;br /&gt;
&lt;br /&gt;
Name : Text2&lt;br /&gt;
Text : (empty)&lt;br /&gt;
&lt;br /&gt;
Press F7, or select View -&amp;gt; Code, then type the following code :&lt;br /&gt;
&lt;pre class="brush:vb;"&gt;Private Sub Text1_Change()
'Text1 use event Change
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim posisi As Integer
&amp;nbsp;&amp;nbsp;&amp;nbsp; posisi = Text1.SelStart
&amp;nbsp;&amp;nbsp;&amp;nbsp; Text1.Text = LCase(Text1.Text)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Text1.SelStart = posisi
End Sub

Private Sub Text2_KeyPress(KeyAscii As Integer)
'Text2 use KeyPress
&amp;nbsp;&amp;nbsp;&amp;nbsp; KeyAscii = Asc(LCase(Chr(KeyAscii)))
End Sub 
&lt;/pre&gt;
&lt;i&gt;Press F5 and see the result&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;T&amp;amp;T#4)&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;&amp;nbsp;CLEAR ALL TEXTBOX VALUE&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Open a new project and place 4 textbox, and 1 commanbutton, let the default property settings do not need to change name or any other properties.&lt;br /&gt;
&lt;br /&gt;
Press F7, and type in the following code :&lt;br /&gt;
&lt;pre class="brush:vb;"&gt;Private Sub Command1_Click()
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim Contrl As Control
&amp;nbsp;&amp;nbsp;&amp;nbsp; For Each Contrl In Form1.Controls
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If (TypeOf Contrl Is TextBox) Then Contrl.Text = ""
&amp;nbsp;&amp;nbsp;&amp;nbsp; Next Contrl
End Sub 
&lt;/pre&gt;
&lt;i&gt;Press F5 and see the result&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;T&amp;amp;T#5)&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;&amp;nbsp;AVOID CERTAIN CHARACTER ENTRY&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Open the new Standard Exe project, then place a textbox and leave the default name 'Text1', then press F7 and type the following code :&lt;br /&gt;
&lt;pre class="brush:vb;"&gt;Private Sub Text1_KeyPress(KeyAscii As Integer)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim sTemplate As String
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Ganti '!@#$%^&amp;amp;*()_+=' dengan karakter yang Anda
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'inginkan untuk dihindari diinput pada Text1
&amp;nbsp;&amp;nbsp;&amp;nbsp; sTemplate = "!@#$%^&amp;amp;*()_+="
&amp;nbsp;&amp;nbsp;&amp;nbsp; If InStr(1, sTemplate, Chr(KeyAscii)) &amp;gt; 0 Then _
&amp;nbsp;&amp;nbsp;&amp;nbsp; KeyAscii = 0
End Sub 
&lt;/pre&gt;
Note the code above, each data that we input in the textbox will be accepted except the characters contained in the&amp;nbsp;&lt;b&gt;sTemplate&amp;nbsp;&lt;/b&gt;variable&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Press F5 and see the result&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;/i&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;T&amp;amp;T#6)&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;span style="color: #990000;"&gt;&lt;b&gt;CALCULATING THE WORD IN TEXTBOX&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Open the new Standard Exe project, and place 1 textbox and 1 commandbutton, and set it with the following properties :&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;TextBox&lt;/u&gt;&lt;br /&gt;
Name : Text1&lt;br /&gt;
Text : (empty)&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;CommandButton&lt;/u&gt;&lt;br /&gt;
Name : cmdCount&lt;br /&gt;
Caption : &amp;amp;Count&lt;br /&gt;
&lt;br /&gt;
Press F7 and type in the following code :&lt;br /&gt;
&lt;pre class="brush:vb;"&gt;Private Sub cmdCount_Click()
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Type a few sentences long enough
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'thus containing up to tens or even hundreds
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'words to try the word count function below.
&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox GetWordCount(Text1.Text)
End Sub

Public Function GetWordCount(ByVal Text As String) As Long
'Define a hyphen at each end
'lines that are part of the whole word,
'so combine together.
&amp;nbsp;&amp;nbsp;&amp;nbsp; Text = Trim(Replace(Text, "-" &amp;amp; vbNewLine, ""))
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Replace a new row with a single space
&amp;nbsp;&amp;nbsp;&amp;nbsp; Text = Trim(Replace(Text, vbNewLine, " "))
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Replace a space more than one (if any)
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'into a single space
&amp;nbsp;&amp;nbsp;&amp;nbsp; Do While Text Like "*&amp;nbsp; *"
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Text = Replace(Text, "&amp;nbsp; ", " ")
&amp;nbsp;&amp;nbsp;&amp;nbsp; Loop
&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Separate the string and return the calculated word
&amp;nbsp;&amp;nbsp;&amp;nbsp; GetWordCount = 1 + UBound(Split(Text, " "))
End Function 
&lt;/pre&gt;
&lt;i&gt;Press F5 and see the result&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;T&amp;amp;T#7)&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;&amp;nbsp;POP UP MENU IN TEXTBOX&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Open the new Standard Standard project, and place 1 textbox and name it Text1, and make a menubar, you can specify what is inside the menubar, note the illustration below&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2TBZIpFn8LENd8aFLOtmp2qwzRyc6bx1jlS0HY0G3mxVlznawDysAYSeAlkgpp4OH7UmSdWc69mMJHhZ481knyqx50j3rRChdtw7qjdYW0diq1euR30kgInpvs1tLsPKSV4JtZHxAUSA/s1600/Ilustrasi1.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2TBZIpFn8LENd8aFLOtmp2qwzRyc6bx1jlS0HY0G3mxVlznawDysAYSeAlkgpp4OH7UmSdWc69mMJHhZ481knyqx50j3rRChdtw7qjdYW0diq1euR30kgInpvs1tLsPKSV4JtZHxAUSA/s320/Ilustrasi1.gif" width="314" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Press F7 and type in the following code :&lt;br /&gt;
&lt;pre class="brush:vb;"&gt;Private Const WM_RBUTTONDOWN = &amp;amp;H204
Private Declare Function SendMessage Lib "user32" Alias _
"SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, lParam As Any) As Long
Public Sub OpenContextMenu(FormName As Form, menuName As Menu)
&amp;nbsp; Call SendMessage(FormName.hwnd, WM_RBUTTONDOWN, 0, 0&amp;amp;)
&amp;nbsp; FormName.PopupMenu menuName
End Sub

Private Sub Form_Load()
&amp;nbsp; MyMenu.Visible = False&amp;nbsp; 'To be invisible at the top of the form
End Sub

Private Sub Text1_MouseDown(Button As Integer, Shift As Integer, _
X As Single, Y As Single)
&amp;nbsp; 'Replace 'MyMenu' with the menu you want to appear as pop up.
If Button = vbRightButton Then _
&amp;nbsp;&amp;nbsp;&amp;nbsp; Call OpenContextMenu(Me, Me.MyMenu)
End Sub
&lt;/pre&gt;
&lt;i&gt;Press F5 and see the result&lt;/i&gt;&lt;br /&gt;
Right click on the textbox and a pop up menu will appear&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;T&amp;amp;T#8)&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;&lt;b&gt;&amp;nbsp;HIGHLIGHT ALL CHARACTERS IN TEXTBOX&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;
Open the new Standard Exe project, then place a textbox and set its properties as follows :&lt;br /&gt;
Name : Text1&lt;br /&gt;
Text : http://ilmalyakin.blogspot.com&lt;br /&gt;
&lt;br /&gt;
Press F7 and type in the following code :&lt;br /&gt;
&lt;pre class="brush:vb;"&gt;Private Sub Text1_GotFocus()
&amp;nbsp; Text1.SelStart = 0
&amp;nbsp; Text1.SelLength = Len(Text1)
End Sub
&lt;/pre&gt;
&lt;i&gt;Press F5 and see the result&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;
&lt;/i&gt;&lt;br /&gt;
&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;T&amp;amp;T#9)&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span class="Apple-style-span" style="color: #990000;"&gt;&amp;nbsp;TEXTBOX VALIDATION&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Open the new Standard Uns project, then place 2 textbox and 1 commandbutton, and set it with the following properties :&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;TextBox&lt;/u&gt;&lt;br /&gt;
Name : Text1&lt;br /&gt;
Text : (empty)&lt;br /&gt;
&lt;br /&gt;
Name : Text2&lt;br /&gt;
Text : (empty)&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;CommandButton&lt;/u&gt;&lt;br /&gt;
Name : cmdExit&lt;br /&gt;
Caption : &amp;amp;Exit&lt;br /&gt;
&lt;br /&gt;
Press F7 and type in the following code :&lt;br /&gt;
&lt;pre class="brush:vb;"&gt;Private Sub cmdExit_Click()
&amp;nbsp;&amp;nbsp;&amp;nbsp; End
End Sub

Private Sub Text1_Validate(Cancel As Boolean)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Cancel = Text1.Text &amp;lt;&amp;gt; "abc"
End Sub
&lt;/pre&gt;
&lt;i&gt;Press F5 an see the result&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
In this example, the cursor will not be able to exit the textbox until the user types "abc". &lt;br /&gt;
&lt;br /&gt;
That's it, some of the common task in TextBox&lt;br /&gt;
&lt;br /&gt;
Good luck.&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;</description><link>http://ilmalyakin.blogspot.com/2010/08/tips-dan-trik-penanganan-textbox.html</link><author>noreply@blogger.com (Ilmal Yakin)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyXkudGI5XPVKL2helcYhwXuIDs_Td184FvplWtouPGdAs8qGbaK2azAVrqi1WdSC9GdCq9bLKLnYT2UlGH4ij1R1CdT4wi3EWjZ_YXeq7yfLUkQDGuwEx6II9IpJc_98LCGqFQADES5U/s72-c/VB6_Logo.png" width="72"/><thr:total>93</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-15139945958479394.post-3320715333140445926</guid><pubDate>Wed, 21 Jul 2010 10:06:00 +0000</pubDate><atom:updated>2018-06-27T11:55:12.737+07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><category domain="http://www.blogger.com/atom/ns#">Visual Basic 6.0</category><title>Create Your Own ActiveX Control With Visual Basic 6</title><description>This time I try to share one of the examples of activex control project is quite simple that is making a timepiece, well without any longer let's start&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyXkudGI5XPVKL2helcYhwXuIDs_Td184FvplWtouPGdAs8qGbaK2azAVrqi1WdSC9GdCq9bLKLnYT2UlGH4ij1R1CdT4wi3EWjZ_YXeq7yfLUkQDGuwEx6II9IpJc_98LCGqFQADES5U/s1600/VB6_Logo.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" data-original-height="180" data-original-width="280" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyXkudGI5XPVKL2helcYhwXuIDs_Td184FvplWtouPGdAs8qGbaK2azAVrqi1WdSC9GdCq9bLKLnYT2UlGH4ij1R1CdT4wi3EWjZ_YXeq7yfLUkQDGuwEx6II9IpJc_98LCGqFQADES5U/s1600/VB6_Logo.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Open the new project with ActiveX Control project type, different from the usual project that is displayed is not the form but the user controls, change the name of the project into MyWatch, then change its user controls to Watch, BorderStyle becomes 0 - None&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTanhLdxuoreFh9JahfVwn-VwdN_H8Di-zk-Hw80F9Gvdhh_p1YeiDVpWiLrpyGEyY9oe3muxnRtJeJpUws_xDu2_cCfmZSDLFjFF88afx-bc_jaMfI5XpbFvtp-RFzTZaxN-V9UMNb-w/s1600/Pict1.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="308" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTanhLdxuoreFh9JahfVwn-VwdN_H8Di-zk-Hw80F9Gvdhh_p1YeiDVpWiLrpyGEyY9oe3muxnRtJeJpUws_xDu2_cCfmZSDLFjFF88afx-bc_jaMfI5XpbFvtp-RFzTZaxN-V9UMNb-w/s400/Pict1.bmp" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Then insert a label into the form and set its property to:&lt;br /&gt;
Name: lblJam&lt;br /&gt;
Appearance: 0 - Flat&lt;br /&gt;
Autosize: True&lt;br /&gt;
BackColor: &amp;amp; H00E0E0E0 &amp;amp;&lt;br /&gt;
BorderStyle: 1 - Fixed Single&lt;br /&gt;
Caption: 00:00:00&lt;br /&gt;
Font: Ms Sans Serif&lt;br /&gt;
Font Style: Bold&lt;br /&gt;
&lt;br /&gt;
The next step we enter a Timer, then set its properties&lt;br /&gt;
Name : tmrJam&lt;br /&gt;
Interval : 1000&lt;br /&gt;
&lt;br /&gt;
Then move the label that we made to the top left corner of the form, then minimize the size of the form of the label we created earlier&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjH2wye508WWljPMBfjThzMGzaQoLt2bsk_kQajFFMBGzq6BWZO4ZeL4H-HKjXoTqxvX5DRz6knFN0aSRgDzF13Z0LSSlCB8CAu8BRTyzg17jwXBwIXiFphT0Hmly4F_KxY4UYNiKcAIzM/s1600/Pict2.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="308" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjH2wye508WWljPMBfjThzMGzaQoLt2bsk_kQajFFMBGzq6BWZO4ZeL4H-HKjXoTqxvX5DRz6knFN0aSRgDzF13Z0LSSlCB8CAu8BRTyzg17jwXBwIXiFphT0Hmly4F_KxY4UYNiKcAIzM/s400/Pict2.bmp" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Well until here we save the first project that we created, for the user controls give the name MyWatch.ctl file, for his project give the name MyWatch.vbp&lt;br /&gt;
&lt;br /&gt;
After the design interface is complete, when it is to add code into the project, double click on user controls add the following code:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:vb;"&gt;Private Sub UserControl_Initialize()
&amp;nbsp;&amp;nbsp;&amp;nbsp; lblJam.Caption = Time
&amp;nbsp;&amp;nbsp;&amp;nbsp; tmrJam.Enabled = True
End Sub
&lt;/pre&gt;
&lt;pre class="brush:vb;"&gt;&lt;/pre&gt;
The Initialize sub procedure will be loaded first when the component is first loaded on the form, then add the following code:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:vb;"&gt;Private Sub tmrJam_Timer()
Dim jam
&amp;nbsp;&amp;nbsp;&amp;nbsp; jam = Time()
&amp;nbsp;&amp;nbsp;&amp;nbsp; lblJam.Caption = jam
End Sub 
&lt;/pre&gt;
&lt;pre class="brush:vb;"&gt;&lt;/pre&gt;
The above procedure will be called when the component is dragged or slid on the form, to specify the font to use, we use the SET function and to read the value we use the GET function, add the following code:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:vb;"&gt;Public Property Set Font(ByVal NewFont As Font)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set lblJam.Font = NewFont
&amp;nbsp;&amp;nbsp;&amp;nbsp; PropertyChanged "Font"
End Property

Public Property Get Font() As Font
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set Font = lblJam.Font
End Property 
&lt;/pre&gt;
&lt;pre class="brush:vb;"&gt;&lt;/pre&gt;
we know each activex control that we have drag into a form then each control will have property value, with SET procedure we can specify some value that we will change in its properties, while the GET procedure later that will take value on the properties and will be applied when an activex control is dragged or slid into a form&lt;br /&gt;
&lt;br /&gt;
Then we add an Event that will be triggered in the event of a change in the activex control&lt;br /&gt;
&lt;br /&gt;
Make sure your cursor is in position (General) (Declaration),&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5jpscU7XR4IZkiVB4rLxnx1iNpX1lVIcIKzEX9VhmRVk6o3Pi7eHc-Cr14ifnGGhgnnxdROK41CIynqm8RwupYCSnf2EiWhmNaXazZSMSm-Hoc-KWblVvfTmjqeeHLUhcSV22LWHNCK0/s1600/Pict3.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="162" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5jpscU7XR4IZkiVB4rLxnx1iNpX1lVIcIKzEX9VhmRVk6o3Pi7eHc-Cr14ifnGGhgnnxdROK41CIynqm8RwupYCSnf2EiWhmNaXazZSMSm-Hoc-KWblVvfTmjqeeHLUhcSV22LWHNCK0/s400/Pict3.bmp" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;
Then type the following code:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:vb;"&gt;Public Event change() 
&lt;/pre&gt;
&lt;br /&gt;
This event we need to detect if there is a change in the activex control that will run a procedure we named SetTime (), type the following code:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:vb;"&gt;Private Sub SetTime(ByVal waktu As String)
&amp;nbsp;&amp;nbsp;&amp;nbsp; lblJam.Caption = waktu
&amp;nbsp;&amp;nbsp;&amp;nbsp; RaiseEvent change
End Sub 
&lt;/pre&gt;
&lt;pre class="brush:vb;"&gt;&lt;/pre&gt;
This procedure will trigger Event change () to run, which will parse a time variable and adjust it to the clock label&lt;br /&gt;
&lt;br /&gt;
To read changes to global properties for fonts, we read through ReadProperties on the UserControl object, in this section the global properties will be read&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:vb;"&gt;Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
&amp;nbsp;&amp;nbsp;&amp;nbsp; lblJam.Font = PropBag.ReadProperty("Font", Ambient.Font)
&amp;nbsp;&amp;nbsp;&amp;nbsp; lblJam.FontBold = PropBag.ReadProperty("FontBold", _
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Ambient.Font.Bold)
&amp;nbsp;&amp;nbsp;&amp;nbsp; lblJam.FontSize = PropBag.ReadProperty("FontSize", _
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Ambient.Font.Size)
End Sub 
&lt;/pre&gt;
&lt;pre class="brush:vb;"&gt;&lt;/pre&gt;
To write the changes that occur on the global property for the font, we do through WriteProperties on the UserControl object&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="brush:vb;"&gt;Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Call PropBag.WriteProperty("Font", lblJam.Font, Ambient.Font)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Call PropBag.WriteProperty("FontBold", lblJam.FontBold, _
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Ambient.Font.Bold)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Call PropBag.WriteProperty("FontSize", lblJam.FontSize, _
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Ambient.Font.Size)
End Sub 
&lt;/pre&gt;
&lt;pre class="brush:vb;"&gt;&lt;/pre&gt;
Procedure is what will make some property values into one unity or become part of the activex itself&lt;br /&gt;
&lt;br /&gt;
Now it is almost finished, now we can save the project, then try to run the project press F5, and see the results that will be opened on the browser that we use&lt;br /&gt;
&lt;br /&gt;
The next step is to compile the project we have created, click the File menu and select Make MyWatch.ocx, then specify the location of the folder where the ocx we will put it, then click the Ok button, now activex control we have successfully created&lt;br /&gt;
&lt;br /&gt;
Now it's time we add the new activex control we created into our application project, open one of your projects, or create a new Standard.exe app, right click on Toolbox, select Components ..., after show click browse button, then search ocx file that we have created "MyWatch.ocx", then click Open, now in the Toolbox there will be a new component that is MyWatch, try to add to the form, the initial view of the ocx is the current time.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCSiCXOGfmUdh_S0AwD-ajU60rgWVctaYR_-FxzGzNQ8x5nVDNn5E5EcBkp-AcT-fKzJbAG9pSTqWEmaK1bkz3UJ5tTZ7JKJD3as3nbxViPIe_QlNT81dS5CnHrF9jmDvy1sA6ARfwypk/s1600/Pict4.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCSiCXOGfmUdh_S0AwD-ajU60rgWVctaYR_-FxzGzNQ8x5nVDNn5E5EcBkp-AcT-fKzJbAG9pSTqWEmaK1bkz3UJ5tTZ7JKJD3as3nbxViPIe_QlNT81dS5CnHrF9jmDvy1sA6ARfwypk/s320/Pict4.bmp" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style="text-align: left;"&gt;
&lt;/div&gt;
</description><link>http://ilmalyakin.blogspot.com/2010/07/membuat-sendiri-kontrol-activex-dengan_21.html</link><author>noreply@blogger.com (Ilmal Yakin)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyXkudGI5XPVKL2helcYhwXuIDs_Td184FvplWtouPGdAs8qGbaK2azAVrqi1WdSC9GdCq9bLKLnYT2UlGH4ij1R1CdT4wi3EWjZ_YXeq7yfLUkQDGuwEx6II9IpJc_98LCGqFQADES5U/s72-c/VB6_Logo.png" width="72"/><thr:total>143</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-15139945958479394.post-1956313599096430879</guid><pubDate>Wed, 02 Dec 2009 11:09:00 +0000</pubDate><atom:updated>2018-06-27T11:55:27.518+07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">SQL</category><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><title>SQL Server Data Type</title><description>&lt;div style="text-align: justify;"&gt;
Determining the right data type is a good database implementation and administration technique. By implementing effective and efficient data types, you can save hard drive space and data processing time from your SQL Server.&lt;br /&gt;
&lt;br /&gt;
Here are some of the built-in data types found in SQL Server along with the space required on the hard drive when implementing it:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi97n86P4uuThgAN2INCqmkKkMIzaMQqp-RfgcOmlw3_Uv0-tRKjlfk4DeMNpZgp0LiQ50OGagwnuvdzcpQYVckO-vvlwzrqah2h72U8pt57MJ6ZjYYWk9unhekw02f5n8UdLpL8r8rBn0/s1600/sql_server_logo.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" data-original-height="180" data-original-width="280" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi97n86P4uuThgAN2INCqmkKkMIzaMQqp-RfgcOmlw3_Uv0-tRKjlfk4DeMNpZgp0LiQ50OGagwnuvdzcpQYVckO-vvlwzrqah2h72U8pt57MJ6ZjYYWk9unhekw02f5n8UdLpL8r8rBn0/s1600/sql_server_logo.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;ul style="text-align: justify;"&gt;
&lt;li&gt;&lt;span style="font-size: 130%;"&gt;&lt;span style="font-weight: bold;"&gt;Bit&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div style="text-align: justify;"&gt;
The bit data type can only accept input numbers 1 and 0 as values (or it could be null, meaning no value). This data type is helpful if you want to generate the output yes / no, true / false, etc.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size: 130%;"&gt;&lt;span style="font-weight: bold;"&gt;Int&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
This data type may already be familiar to you. This data type can receive values ranging from -2&lt;sup&gt;31&lt;/sup&gt; (-2,147,483,648) to 2&lt;sup&gt;31&lt;/sup&gt;-1 (2,147,483,647). This data type consumes 4 bytes to store data on the hard drive.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size: 130%;"&gt;&lt;span style="font-weight: bold;"&gt;Bigint&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
This data type is similar to int, only the received value is greater than int. This data type can receive values ranging from -2&lt;sup&gt;63&lt;/sup&gt; (-9,223,372,036,854,775,808) to 2&lt;sup&gt;63&lt;/sup&gt;-1 (-9,223,372,036,854,775,807). This data type consume 8 bytes to store data on the hard drive.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size: 130%;"&gt;&lt;span style="font-weight: bold;"&gt;Smallint&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
This data type is also similar to int, only the received value is smaller than int. This data type can receive values ranging from -2&lt;sup&gt;15&lt;/sup&gt; (-32,768) to 2&lt;sup&gt;15&lt;/sup&gt;-1 (32767). This data type requires only 2 bytes to store data on the hard drive.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size: 130%;"&gt;&lt;span style="font-weight: bold;"&gt;Tinyint&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
This data type receives a value smaller than smallint. Acceptable values range from 0 to 255, and require only 1 bytes to store data on the hard drive.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size: 130%;"&gt;&lt;span style="font-weight: bold;"&gt;Decimal&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
This data type receives a more precise value than the integer data types discussed earlier. This data type uses 2 parameters to determine the level of precision of the value received; precision and scale. Precision is the number of digits that can be received by the field, while the scale is the number of numbers behind the comma that can be accepted by the field. So, if we make the precision parameter as much as 5 and scale 2 then field we can accept value like this: 123,45. This data type can receive values ranging from -10&lt;sup&gt;38&lt;/sup&gt; to 10&lt;sup&gt;38&lt;/sup&gt;-1. This data type consumes 5-17 bytes to store data on the hard drive, depending on the precision of the inserted value.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size: 130%;"&gt;&lt;span style="font-weight: bold;"&gt;Numeric&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
This data type is basically the same as the decimal data type. So this data type can be called a synonym of decimal.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size: 130%;"&gt;&lt;span style="font-weight: bold;"&gt;Money&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
This data type can receive values ranging from -2&lt;sup&gt;63&lt;/sup&gt; (-9,223,372,036,854,775,808) to 2&lt;sup&gt;63&lt;/sup&gt;-1 (-9,223,372,036,854,775,807). This data type consumes 8 bytes to store data on the hard disk.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size: 130%;"&gt;&lt;span style="font-weight: bold;"&gt;Smallmoney&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
This data type is basically the same as the data type of money, only the received value is smaller, ranging from -214,748,3648 to 214,748,3647. This data type consumes 4 bytes to store data on the hard drive.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size: 130%;"&gt;&lt;span style="font-weight: bold;"&gt;Float&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
This data type is similar to the decimal data type, it's just that the paramater scale on this data type can accept infinite value, as in the value of pi. This data type can receive values ranging from -1.79E + 308 to 1.79E +308. If you are describing a field with a data type like this: float (2), then the output value of pi (for example) is 3.14. The number 2 inside the brackets explains how many numbers should be displayed behind the comma. This data type consumes 4-8 bytes to store data on the hard drive.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size: 130%;"&gt;Real &lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
This data type is similar to the float data type, it just receives a smaller value than the float, which starts from -3.40E +38 to 3.40E +38. This data type consumes 4 bytes to store data on the hard drive.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size: 130%;"&gt;&lt;span style="font-weight: bold;"&gt;Datetime&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
This data type can receive date and time values from 1 January 1753 to 31 December 9999. This data type consumes 8 bytes to store data on the hard disk..&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size: 130%;"&gt;&lt;span style="font-weight: bold;"&gt;Smalldatetime&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
This data type can receive dates and times from January 1, 1900 to June 6, 2079, with the accuracy of the time used is minutes. This data type consumes 4 bytes to store data on the hard disk..&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size: 130%;"&gt;&lt;span style="font-weight: bold;"&gt;Timestamp&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
This data type is used to record records when new data is inserted and updated. This data type is very useful to find out the changes that occur in your database.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size: 130%;"&gt;&lt;span style="font-weight: bold;"&gt;Uniqueidentifier&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
This data type works to create a unique value that might look like this 6F9619FF-8B86-D011-B42D-00C04FC964FF. This data type is useful if you want to create a unique serial number or id.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size: 130%;"&gt;&lt;span style="font-weight: bold;"&gt;Char&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
This data type can be used to enter non-Unicode character data with a fixed number of characters. This data type can accept up to 8000 characters, and the number of bytes required depends on the number of characters entered. 1 character requires 1 bytes, so if you define it like this: char (5) then the field can only accept characters as many as 5 characters with space needed to store data on hard drive as much as 5 bytes.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size: 130%;"&gt;&lt;span style="font-weight: bold;"&gt;Varchar&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
This data type is similar to the char data type, but this data type is useful for you who do not know exactly the number of characters that will be entered by the user. This data type can also receive values up to 8000 characters. So if in the char data type, you define char (5), then you will always need 5 bytes to store data on the hard disk, although the number of characters entered is only 1 to 4 characters; then in this type of data, the number of bytes required will be more flexible. For example if you define varchar (30) for a field, then the field can receive data up to 30 characters (30 bytes), but if you only enter 1 character, then the number of bytes required is only 1 bytes.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size: 130%;"&gt;&lt;span style="font-weight: bold;"&gt;Varchar(max)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
This data type is also similar to varchar, it's just, the acceptable value reaches 2^31-1 (2,147,438.67) bytes of data.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size: 130%;"&gt;&lt;span style="font-weight: bold;"&gt;Nchar&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
This type of data is similar to the char data type, but this data type can accept Unicode values or data (in contrast to char data types that can only accept non-Unicode character values). This data type can receive values up to 4000 characters. This data type consumes 2-8000 bytes to store data on the hard disk. Why it takes 2-8000 bytes? Because this data type multiplies 2 bytes for each character. So if the user only enter 1 character, it takes 2 bytes to store data on the hard drive.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size: 130%;"&gt;&lt;span style="font-weight: bold;"&gt;Nvarchar&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
This data type is similar to the varchar data type, but this data type can accept Unicode values or data. This data type can also receive values up to 4000 characters.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size: 130%;"&gt;&lt;span style="font-weight: bold;"&gt;Nvarchar(max)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
This data type is similar to varchar data type (max), but this data type can accept Unicode value or data. This data type can accept characters up to 2 &lt;span style="font-size: 100%;"&gt;&lt;sup&gt;31&lt;/sup&gt; &lt;/span&gt;- 1 (2,147,483,67) bytes data.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size: 130%;"&gt;&lt;span style="font-weight: bold;"&gt;Binary&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
This data type can receive binary data with a maximum of 8000 bytes of data. This data type is interpreted as a string of bits eg (110011001011).&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size: 130%;"&gt;&lt;span style="font-weight: bold;"&gt;Varbinary&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
This data type is similar to varchar, it's just acceptable value only binary data. This data type is useful for storing unknown binary data with exact number of bytes of data.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style="font-size: 130%;"&gt;&lt;span style="font-weight: bold;"&gt;Xml&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
This data type is useful for storing data in XML Document format. This data type can store data up to 2Gb. This data type is a new data type contained in SQL Server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That's it, a brief explanation of some data types contained in SQL Server. Although there are actually some other types of data built-in, but the data type above is the type of data that we often use.&lt;/div&gt;
&lt;br /&gt;</description><link>http://ilmalyakin.blogspot.com/2009/12/tipe-data-pada-sql-server-2005_6886.html</link><author>noreply@blogger.com (Ilmal Yakin)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" height="72" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi97n86P4uuThgAN2INCqmkKkMIzaMQqp-RfgcOmlw3_Uv0-tRKjlfk4DeMNpZgp0LiQ50OGagwnuvdzcpQYVckO-vvlwzrqah2h72U8pt57MJ6ZjYYWk9unhekw02f5n8UdLpL8r8rBn0/s72-c/sql_server_logo.png" width="72"/><thr:total>2</thr:total></item></channel></rss>