449 Posted Topics

Member Avatar for Man1919

The following code converts "בניית ביניינים מתקדמים" to "BPJJZ_BJPJJPJM_NZWDNJM" [CODE=vb] Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click TextBox2.Clear Dim dic As New Dictionary(Of Char, Char) With dic .Add("א"c, "A"c) .Add("ב"c, "B"c) .Add("ג"c, "C"c) .Add("ד"c, "D"c) .Add("ה"c, "E"c) .Add("ו"c, "F"c) .Add("ז"c, "G"c) .Add("ח"c, "H"c) .Add("ט"c, "I"c) .Add("י"c, "J"c) …

Member Avatar for Man1919
0
438
Member Avatar for abc88

You probably have an error already while connection to your datasource. The Finally block get executed, no matter what. means if there is an error on the connection, then the execute command will fail as well. try to use this code and see what error message pops up: [CODE=vb] Try …

Member Avatar for GeekByChoiCe
0
844
Member Avatar for kasimacsys

hmm i have solved that problem in the past like this [code=vb] Dim menuStrip As Contexmenu= DirectCast(Form1.Controls.Find(menuname, True)(0), Contexmenu) menuStrip.Enable=True [/code]

Member Avatar for bunthom
0
1K
Member Avatar for Arunabh Nag

why not just google for what he told you? i straight came to [url]http://msdn.microsoft.com/en-us/library/system.data.datatable_members.aspx[/url]

Member Avatar for SadiSerdari
0
2K
Member Avatar for roottybrian

you would find all 3 answers if you use the forums search! why opening always new threads if the questions are already answered 100 times?

Member Avatar for gever
0
194
Member Avatar for hajjo

Thats depends... are you moving the mouse to another control on your form? if so you could just raise the click event for this control. lets say you move the mouse to textbox1 then you just do : [icode]textbox1_Click(me, new system.eventargs)[/icode] ofcourse this event have to exist. If there is …

Member Avatar for josephbeluan
0
954
Member Avatar for docfnt

it is might not the cleanest solution but works so far [CODE=vb] Private Sub RichTextBox1_TextChanged(sender As System.Object, e As System.EventArgs) Handles RichTextBox1.TextChanged If RichTextBox1.Lines.Last.StartsWith("'") Then RichTextBox1.SelectionStart = RichTextBox1.GetFirstCharIndexOfCurrentLine RichTextBox1.SelectionLength = RichTextBox1.Lines.Last.Length RichTextBox1.SelectionColor = Color.Green RichTextBox1.Select(RichTextBox1.Lines.Last.Length, 1) Else RichTextBox1.SelectionColor =color.Black End If End Sub [/CODE]

Member Avatar for GeekByChoiCe
0
172
Member Avatar for tonyfonseca

[CODE=vb] Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click TextBox1.Text = "3:05" TextBox2.Text = "1:00" TextBox3.Text = "0:55" Dim span As New TimeSpan span = TimeSpan.Parse(TextBox1.Text) + TimeSpan.Parse(TextBox2.Text) + TimeSpan.Parse(TextBox3.Text) TextBox4.Text = span.ToString End Sub [/CODE]

Member Avatar for abirami2908
0
4K
Member Avatar for RenanLazarotto

here is a small example which should give you an idea how to do it... [CODE=vb] Module Module1 Sub Main() Dim myProc As New Process() With myProc .StartInfo.FileName = "notepad.exe" .EnableRaisingEvents = True AddHandler .Exited, AddressOf MyProc_Exited .Start() End With Console.Read End Sub Private Sub MyProc_Exited(sender As Object, e As …

Member Avatar for RenanLazarotto
0
230
Member Avatar for Resentful

try this: Dim testString As String = String.Format("1={0}&2={1}&3={2}&5={3}&6=yes", numbers.lines(count), Second.text, third.text, random.Next(9, 18)) Debug.writeline(testString)

Member Avatar for Resentful
0
121
Member Avatar for Karl Luders
Member Avatar for Viperino

i assume you forgot the " in line 5 just here. So if you change MsgBox("Not possible to read file.") to MsgBox(ex.message) then it will tell you what is wrong.

Member Avatar for kvprajapati
0
126
Member Avatar for swathys

[CODE=vb] Dim sPath As String = String.Format("{0}{1}{0}", Chr(34), IO.Path.Combine(My.Computer.FileSystem.SpecialDirectories.Desktop, "APPLICATION B.exe")) If Process.GetProcessesByName("APPLICATION B.exe").Count = 0 Then Debug.Print("1 sPath=>" & sPath) File.Exists(sPath) Debug.Print("2 sPath=>" & sPath) Dim ShellProcess As New Process ShellProcess.StartInfo.FileName = sPath Debug.Print("ShellProcess.StartInfo.FileName=>" & ShellProcess.StartInfo.FileName) ShellProcess.StartInfo.UseShellExecute = True Debug.Print("ShellProcess.StartInfo.UseShellExecute=>" & ShellProcess.StartInfo.UseShellExecute) Dim isRunning As Boolean = ShellProcess.Start() Debug.Print("ShellProcess.Start=>" …

Member Avatar for swathys
0
135
Member Avatar for Riga

That doesnt work like this. DayOfWeek is an ENUM... try something like this: [CODE=vb] Dim nodeNamaHari As DayOfWeek For Each d In [Enum].GetNames(nodeNamaHari.GetType) nodeBulan.Nodes.Add(d) Next [/CODE]

Member Avatar for Riga
0
330
Member Avatar for harry.jhone

I really don't want to be rude now...but I really hope there is no such software. Everyone who develop software should HAVE programming skill and layout knowledge.

Member Avatar for kvprajapati
0
276
Member Avatar for afaque01

[CODE=vb] If C1.Text = "Agra Fort" AND C2.Text = "Delhi" Then L8.Text = "800Rs/-" End If [/CODE]

Member Avatar for afaque01
0
85
Member Avatar for Ghostt0

are you looking for something like this? [CODE=vb] Private Structure myTest Dim x As Integer Dim y As String Dim z As Short End Structure Dim xyz As New myTest With {.x = 10, .z = 12} Dim fields As System.Reflection.FieldInfo() = xyz.[GetType]().GetFields(System.Reflection.BindingFlags.Instance Or System.Reflection.BindingFlags.[Public]) For Each field As System.Reflection.FieldInfo …

Member Avatar for GeekByChoiCe
0
98
Member Avatar for urataru17

Does this error occur also when you just start VS and create a new VB project? Does it occur when you open a random VB project? or just when you open your own project?

Member Avatar for GeekByChoiCe
-1
201
Member Avatar for veyske

the whole problem lays in "Class frmMultiplayer" you have declared: Dim msNickname As String = txtNickname.Text as global variable. But txtNickname does not exist yet....

Member Avatar for GeekByChoiCe
0
122
Member Avatar for Spacenoobie

First i am confused how u get A=0 as A's ascii code is 65 Anyway below is the code to convert all letter to their ascii code. [CODE=vb] Imports System.Text.RegularExpressions Module Module1 Sub Main() Dim str As String = "123A456B789" Dim reg As New Regex("[a-zA-Z]") Dim newString As String = …

Member Avatar for GeekByChoiCe
0
766
Member Avatar for tinstar

shouldnt it be: totalTicketSalesDecimal += seatsSoldInteger * costDecimal so its adding the result to the totalTicketSalesDecimal

Member Avatar for jlego
0
283
Member Avatar for jcb0806

[CODE=vb] Dim num1 As Double = 2.8399999999999999 Dim num2 As Double = 3.1000000000000001 Dim num3 As Double = 4.8689999999999998 Debug.WriteLine(num1.ToString("F5")) Debug.WriteLine(num2.ToString("F5")) Debug.WriteLine(num3.ToString("F5")) [/CODE] Retruns: 2,84000 3,10000 4,86900

Member Avatar for jcb0806
0
212
Member Avatar for keeda

if you have a ftp server running on your linux box then why not using: [CODE=vb] My.Computer.Network.UploadFile("c:/complete/path/to/file", "ftp://your.url.com/path", "username", "password") [/CODE]

Member Avatar for ANXIOUS117
0
135
Member Avatar for iWarrior

just a blue shot... UPDATE tblfirsthalf SET ShotsInsidePA = CInt(ShotsInsidePA) + 1 WHERE PlayerNumber = 1 if im not mistaken the sql statement dont know the datatype of a field. so it takes by default string, which have different behave on a operator like +

Member Avatar for GeekByChoiCe
0
237
Member Avatar for bklynman01

this DocViewFrm dont exist anymore when you close it. so each time you need that window do: [CODE=vb] dim frm as new DocViewFrm frm. show ... frm.close [/CODE]

Member Avatar for bklynman01
0
202
Member Avatar for Bardan Jusik

it is actually enough to loop over the half of the word [CODE=vb] Sub Main() Dim word As String = "lagerregal" For I = 0 To word.Length - 1 / 2 If word.Substring(CInt(I), 1) = word.Substring(word.Length - CInt(I) - 1, 1) Then Continue For Else Console.WriteLine("The word is not a …

Member Avatar for Bardan Jusik
0
308
Member Avatar for swathys

where and how you define FromDate and ToDate? also are you sure about your Where clause? i dont think it will ever return something since u check the same field for two different values

Member Avatar for Netcode
0
84
Member Avatar for allen2663

try this: [CODE=vb] psi.Arguments = String.Format("/F /IM {0}movie sleuth.exe{0}", Chr(34)) [/CODE]

Member Avatar for allen2663
0
301
Member Avatar for krusnik08

see if that helps... [CODE=vb] Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim numbers() As Integer = {CInt(TextBox1.Text), CInt(TextBox2.Text), CInt(TextBox3.Text)} Label10.Text = CStr(numbers.Max) Label12.Text = CStr(numbers.Min) Dim tmpArray As New ArrayList 'to hold the uniq numbers For Each num As Integer In numbers Dim i …

Member Avatar for GeekByChoiCe
0
177
Member Avatar for yongj

maybe not the best solution but a working one... [CODE=vb] Dim arr1() As String = {"BAX", "XDS", "AAA", "GFD", "AAB"} Dim arr2() As String = {"67", "45", "2", "88", "89"} Dim arr3() As String = {"b4", "g5", "j3", "k8", "d3"} Dim arr4() As String = {"df", "hj", "tz", "we", "xs"} …

Member Avatar for GeekByChoiCe
0
459
Member Avatar for yongj

why not just: [CODE=vb] Dim lines() As String = IO.File.ReadAllLines("C:\myFie.txt") For Each line As String In lines 'do what you want with each single line Next [/CODE]

Member Avatar for GeekByChoiCe
0
11K
Member Avatar for chono

maybe that helps: [CODE=vb] Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click TextBox1.Text = "abcaba" Dim dic As New Dictionary(Of Char, Integer) For Each c As Char In TextBox1.Text If dic.ContainsKey(c) Then dic(c) += 1 Else dic.Add(c, 1) End If Next For Each d As KeyValuePair(Of …

Member Avatar for GeekByChoiCe
0
115
Member Avatar for dre-logics

[CODE=vb] Debug.WriteLine(My.Computer.FileSystem.GetFileInfo("C:\image.png").Length) 'OR Debug.WriteLine((New IO.FileInfo("C:\image.png")).Length) [/CODE]

Member Avatar for kvprajapati
0
681
Member Avatar for naveedqadri

Dim strDTM As String = dtmInputBox.PadLeft(6, "0") will fill your string with leading 0 on a total length of 6

Member Avatar for naveedqadri
0
139
Member Avatar for TheMightySpud

small example: [CODE=vb] Dim str As String = "NW at 6 mph" Dim reg As New Text.RegularExpressions.Regex("[0-9]{1,}") Debug.WriteLine(reg.Match(str).Value) [/CODE]

Member Avatar for GeekByChoiCe
0
117
Member Avatar for eikal

tcpclient.Close() <<< thats the reason this code is made for demonstration only and closes after first receive. You have to add some eventhandlers for client connect, receiving and so and only close the tcpclient if you really want it.

Member Avatar for GeekByChoiCe
-1
60
Member Avatar for kberrianjr
Member Avatar for spiffy577

you could show some kind of "freezer" form. just create a snapshot of the current form and display it in the freezed form while your dll is loading

Member Avatar for spiffy577
0
423
Member Avatar for SaaDwTk

i hope i understood you correct. [CODE=vb] Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim reg As New RegularExpressions.Regex("[,.;]") 'add here punctuation if needed 'remove punctuation and split string by whitespace Dim str1() As String = reg.Replace(TextBox1.Text, " ").Split(New String() {" "}, StringSplitOptions.RemoveEmptyEntries) TextBox3.Text = …

Member Avatar for GeekByChoiCe
0
79
Member Avatar for dre-logics

try [CODE=vb] Process.Start("C:/Program Files/MySQL/MySQL Server 5.1/bin/mysqldump.exe", " --host=localhost --user=my --password=12345 --databases test > -r " & chr(34) & My.Settings.Locbackup & chr(34)) [/CODE] most of time its all about the quotes.

Member Avatar for dre-logics
0
625
Member Avatar for TheMightySpud

a bit more dynamic way... [CODE=vb] Private Sub button_Clicks(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn2.Click, btn3.Click CType(CreateForm(CStr(CType(sender, Button).Tag)), Form).Show() End Sub Private Shared Function CreateForm(ByVal requestedForm As String) As Object Dim myAssembly As System.Reflection.Assembly = System.Reflection.Assembly.GetExecutingAssembly() Dim frm = (From g In myAssembly.GetTypes Where g.BaseType.FullName = "System.Windows.Forms.Form" …

Member Avatar for GeekByChoiCe
0
142
Member Avatar for raaif

hope i understood your question correctly [CODE=vb]Private Sub ShortWay() Dim st As String = "myString" Dim result As String = String2Unicode(st).Replace(Chr(0), Chr(0) & "|") Console.WriteLine(result) End Sub Private Sub LongWay() Dim st As String = "myString" Dim sb As New Text.StringBuilder For Each c As Char In st sb.AppendFormat("{0}|", String2Unicode(c)) …

Member Avatar for GeekByChoiCe
0
137
Member Avatar for lazynewt

think that might help --> [url]http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.begingetresponse.aspx[/url]

Member Avatar for lazynewt
0
262
Member Avatar for swathys
Member Avatar for mihird

could you please post your code that belongs to the whole case? such as the source of listbox items, the backgroundworker initializing and its methods?

Member Avatar for mihird
0
103
Member Avatar for keedier
Member Avatar for codeorder
0
238
Member Avatar for raaif

Array.Reverse is a procedure without a return type. To fill your arrays you should reverse it and then copy into the array just like [CODE=vb] Private mapAsciiToUnicode() As String = {"h" >= "1920", "S" >= "1921", "n" >= "1922", "r" >= "1923", "b" >= "1924", "L" >= "1925", "k" >= …

Member Avatar for GeekByChoiCe
0
292
Member Avatar for Kingcoder210
Member Avatar for absoluthamm

Ok, here is a working snippet: [CODE=vb] Public Class DataNotes 'to hold the information Public Property NameId As String Public Property ColorId() As Integer Public Property Text() As String End Class Sub ReadData() Dim myData As New List(Of DataNotes) Dim regex As New Text.RegularExpressions.Regex("^NOTE NameId=""(.*)"" ColourId=""([0-9]{1,})"" Text=""(.*)""", Text.RegularExpressions.RegexOptions.Multiline) For Each …

Member Avatar for GeekByChoiCe
0
162
Member Avatar for arjen

[CODE=vb] Dim myFile As String = "C:\report.html" Dim stream As New IO.FileStream(myFile, IO.FileMode.Create) Dim writer As New IO.StreamWriter(stream) writer.WriteLine(TextBox8.Text) writer.WriteLine(DateTimePicker1.Text) writer.WriteLine(<p/>) writer.WriteLine("<table width='95%' border='1' cellspacing='1' cellpadding='1'> ") writer.WriteLine(<tr> <td><strong>Customer Name</strong></td> <td><strong>Cost</strong></td> <td><strong>Number of hours</strong></td> <td><strong>Time Start</strong></td> <td><strong>Time Remaining</strong></td> <td><strong>Facility Name</strong></td> <td><strong>Amenity Name</strong></td> <td><strong>Incharge Employee</strong></td> </tr>) For Each item As ListViewItem …

Member Avatar for GeekByChoiCe
0
250

The End.