449 Posted Topics

Member Avatar for skp03

Ok, your question is really confusing. Could you explain it somehow better? If possible with a small example.

Member Avatar for adam_k
0
428
Member Avatar for bhagawatshinde

Yes, this exception get raised if you try to access your controls from the backgroundworker. You can only access the controls from the thread, they were created on (so, the main thread) Hope the following example will explain it better: [CODE=vb] Imports System.ComponentModel Public Class BGW Dim BGW As BackgroundWorker …

Member Avatar for bhagawatshinde
0
1K
Member Avatar for aerohn

Data type mismatches mostly happens if you try to fill your dataset field with a value that is not of the type as in your database. In example you try to fill an image field into a Integer field. So please post the table definition and the query you use …

Member Avatar for aerohn
0
3K
Member Avatar for compulove

why so complicated? Try this: [CODE=vb] Dim DestinationDirectory As String = "I:\New\Export\ID" Dim SourceDirectory As String = "C:\Temp2\" Dim overwrite As boolean = true my.Computer.FileSystem.CopyDirectory(SourceDirectory,DestinationDirectory,overwrite) [/CODE]

Member Avatar for bluehangook629
0
3K
Member Avatar for bluehangook629

If you just want to register a dll then try to use this: Start -> Run -> type in -> REGSVR32.EXE Path/to/dll to unregister: REGSVR32.EXE /u Path/to/dll

Member Avatar for bluehangook629
0
262
Member Avatar for VIPER5646

You don't need to have two arraylists. Here is an example, how it would be better: [CODE=vb] Private Sub pop_combo_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load Dim Jobs As New Dictionary(Of Integer, String) 'instead of this loop you do your data reading here For i As Integer = 1 …

Member Avatar for VIPER5646
0
152
Member Avatar for shers

Using the InitializeComponent() procedure is the problem. Instead of using this method, you should create a custom method that will "reset" all your controls. On this way you are not overwriting the handlers of your controls event. If you use InitializeComponent() you actually create a new button for which a …

Member Avatar for GeekByChoiCe
0
176
Member Avatar for consc197

You can do it on two ways. 1. you create a MDI form with a menustrip and add all your forms as MDI childs 2. You create 1 form with a menustrip and inherit all your forms from this form. so assuming you have created a form named "BaseForm" with …

Member Avatar for consc197
0
167
Member Avatar for consc197

Password is a reserved word in every database. Use [Password] instead. With Username im not sure, so better use [Username] as well.

Member Avatar for consc197
0
220
Member Avatar for cyberwarezcp

If you really want to do that, then i would suggest to use a backgroundworker. Before starting this worker, you disable all controls that you need to disable and display the wait image. In the dowork event of that worker you do your sql query. In the work_complete event of …

Member Avatar for cyberwarezcp
0
145
Member Avatar for Darkicon

Here is a working example: [CODE=vb] Imports System.Text Public Class Form1 'Create the query Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click Dim table As String = "testTable" 'whatever your table name is Dim columnCount As Integer = DataGridView1.Columns.Count - 1 'get the count of columns Dim sb …

Member Avatar for GeekByChoiCe
0
173
Member Avatar for ItDir

I would guess that the plugin/dll is not available as 64bit version. Have you tried to develop you application for x86 only?

Member Avatar for GeekByChoiCe
0
798
Member Avatar for Jollyyy100

Yes, it is possible. Assuming your MDI Child is Form2: [CODE=vb] Public Class Form2 Private thisMenu As ContextMenu Private Sub Form2_Load(sender As Object, e As System.EventArgs) Handles Me.Load thisMenu = New ContextMenu Dim item1 As New MenuItem("entry1", AddressOf Item1_Click, Nothing) Dim item2 As New MenuItem("entry2", AddressOf Item2_Click, Nothing) thisMenu.MenuItems.Add(item1) thisMenu.MenuItems.Add(item2) …

Member Avatar for Jollyyy100
0
160
Member Avatar for Shodow

Actually if you want to transfer ALL items from one listbox to another then you can simple do that like the sample below. No looping needed. [CODE=vb] Private Sub MoveToBox2_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click ListBox2.Items.Clear() ListBox2.Items.AddRange(ListBox1.Items) ListBox1.Items.Clear() End Sub Private Sub MoveToBox1_Click(sender As System.Object, e As System.EventArgs) …

Member Avatar for Shodow
0
175
Member Avatar for William Ng

Maybe this is something you look for: [CODE=vb] Public Class Form1 Private DefaultStyle As DataGridViewCellStyle Private Sub DataGridView1_CurrentCellDirtyStateChanged(sender As Object, e As System.EventArgs) Handles DataGridView1.CurrentCellDirtyStateChanged If DataGridView1.IsCurrentRowDirty Then DataGridView1.CurrentRow.DefaultCellStyle = New DataGridViewCellStyle With {.BackColor = Color.Red, .ForeColor = Color.White} Else DataGridView1.CurrentRow.DefaultCellStyle = DefaultStyle End If End Sub Private Sub Form1_Load(sender …

Member Avatar for William Ng
0
167
Member Avatar for bilal_fazlani

You could try something like this: [CODE=vb] Dim DummyParameters() As String = New String() { If(tbx_transaction_id.Text = "", Nothing, String.Format("trans_id='{0}'", tbx_transaction_id.Text)), If(tbx_cust_id.Text = "", Nothing, String.Format("customers.cust_id = '{0}'", tbx_cust_id.Text)), If(tbx_amount.Text = "", Nothing, String.Format("trans_amount = '{0}'", tbx_amount.Text)), If(tbx_name.Text = "", Nothing, String.Format("fname='{0}%' or lname='{0}%'", tbx_name.Text))} Dim finalParameters As IEnumerable(Of String) …

Member Avatar for bilal_fazlani
0
166
Member Avatar for moone009

Here is an example that will copy all "jpg" files, found in one directory, to another directory. [CODE=vb] Dim overwrite As boolean Dim destinationFolder As string = "C:\Users\GeekByChoiCe\Desktop\dump" Dim files() As String = IO.Directory.GetFiles("C:\Users\GeekByChoiCe\Desktop\myhouse", "*.jpg",io.SearchOption.AllDirectories) Array.ForEach(files, Sub(sinfleFile As String) io.File.Copy(sinfleFile,io.Path.Combine(destinationFolder, io.Path.GetFileName(sinfleFile)), overwrite) End Sub) [/CODE]

Member Avatar for GeekByChoiCe
0
354
Member Avatar for mags11

Yes, because you clear your textboxes, which raise the "TextChanged" Events. Just add a check to your "TextChanged" Events for Text being empty. this will solve your problem.

Member Avatar for mags11
0
413
Member Avatar for polinolin
Member Avatar for polinolin
0
130
Member Avatar for Trle94

I think the "CheckForIllegalCrossThreadCalls = False" causes the strange things happens. Definition of CheckForIllegalCrossThreadCalls: [QUOTE]Gets or sets a value indicating whether to catch calls on the wrong thread that access a control's Handle property When a thread other than the creating thread of a control tries to access one of …

Member Avatar for Trle94
0
264
Member Avatar for muneeb213
Member Avatar for muneeb213
0
500
Member Avatar for beforetheyknew

I don't know what the difference is between ans1 and TextBox1 so i just ignored that. Here is a complete code for your guessing form: [CODE=vb] Public Class Form1 Dim guess As Integer Private Sub StartGame() Dim generator As New Random ran1.Text = CStr(generator.Next(1, 100)) ran2.Text = CStr(generator.Next(1, 100)) ans1.Text …

Member Avatar for GeekByChoiCe
0
97
Member Avatar for maggoteer

I assume you have "MySQL Connector Net" installed on your machine. So either you create a setup project and add this to your pre-requirements OR you copy the MySql.Data.dll to your project, set its build action to none and also set it to "copy always".

Member Avatar for GeekByChoiCe
0
109
Member Avatar for VB 2012

I don't know how you read in your settings file so maybe this gives you an idea: [CODE=vb] Dim dummy() As String = New String() {"", "entry 1", "entry 2", Nothing, "entry 3"} ListBox1.DataSource = dummy.Where(Function(s) Not String.IsNullOrEmpty(s)).ToArray [/CODE]

Member Avatar for VB 2012
0
137
Member Avatar for johmolan

[CODE=vb] Dim fromFolder As String = IO.Path.Combine(My.Application.Info.DirectoryPath, "exc2") If IO.Directory.Exists(fromFolder) Then 'show the FolderBrowserDialog for destination folder End If [/CODE]

Member Avatar for GeekByChoiCe
0
536
Member Avatar for Gh0stRa1n

maybe this helkps [url]http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.redirectstandardoutput.aspx[/url]

Member Avatar for GeekByChoiCe
0
109
Member Avatar for PM312

open your form in the design-view. Click F7 to get in to the code behind file. You have to create your procedure inside the Class. IE: (asuming your form name is Form1...) [CODE=vb] Public Class Form1 Private Sub CmdDisabl() Cmd_New.Enabled = False Cmd_Amend.Enabled = False End sub End Class [/CODE]

Member Avatar for codeorder
0
197
Member Avatar for danielgr

Its actually not much work. Check this example: The Designer part: [CODE=xml] <Window x:Class="MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:WpfApplication1" Title="MainWindow" Height="400" Width="600"> <Grid> <Grid.RowDefinitions> <RowDefinition /> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <Grid.Resources> <HierarchicalDataTemplate DataType="{x:Type local:Dummy}" ItemsSource="{Binding Path=.}"> <StackPanel> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Path=ID}" /> <TextBlock Text=" - …

Member Avatar for danielgr
0
1K
Member Avatar for Aviplo
Member Avatar for adam_k
0
223
Member Avatar for Aviplo
Member Avatar for Reverend Jim
0
242
Member Avatar for pankaj.garg

something like this should work: [CODE=vb] Public Class Form1 Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load RecurseContainers(Me) End Sub Private Sub RecurseContainers(container As Control) For Each ctrl In container.Controls If TypeOf (ctrl) Is TextBox Then SetHandler(CType(ctrl, TextBox)) 'add handler to textbox Continue For End If If TypeOf …

Member Avatar for pankaj.garg
0
383
Member Avatar for VB 2012

From what i see the problem seems to be: If OptionsForm.AutoSaveallOnExitCKB.CheckState I assume the OptionsForm is a Form, that is not initialized at that time. So the CheckBox AutoSaveallOnExitCKB is also not initialized. I would suggest to save the option "SaveOnClose" also in your My.Settings and check its value instead.

Member Avatar for GeekByChoiCe
0
135
Member Avatar for eawedat

something like this should do the trick... [CODE=vb] Private Sub TextBox1_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown If e.Control AndAlso e.KeyCode = Keys.V Then Dim s As String = My.Computer.Clipboard.GetText.Trim If s.Length = 16 Then TextBox1.Text = s.Substring(0, 4) TextBox2.Text = s.Substring(3, 4) TextBox3.Text = s.Substring(6, 4) TextBox4.Text = …

Member Avatar for GeekByChoiCe
0
584
Member Avatar for computbill

The "SetChildIndex" is the key. Check out this example: [CODE=vb] Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles Me.Load 'create panel Dim imagePanel As New Panel With {.Width = 500, .Height = 500} Me.Controls.Add(imagePanel) 'create images Dim pictures() As String = IO.Directory.GetFiles("C:\Users\Public\Pictures\Sample Pictures") Dim x As Integer = 1 …

Member Avatar for GeekByChoiCe
0
190
Member Avatar for LDiver

instead of checking all the time the whole text you can use this code: [code=vb] Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress If Not Char.IsNumber(e.KeyChar) Then e.Handled = True End If End Sub[/code] this will allow only numbers beeing written in the textbox and ignores …

Member Avatar for nedrosat
0
915
Member Avatar for renzlo

Here is a working example [CODE=vb] Sub Main() If not CompareFiles("C:\Users\GeekByChoiCe\Desktop\dummy.txt", "C:\Users\GeekByChoiCe\Desktop\Backup") Then Console.WriteLine("file does not exist") Else Console.WriteLine("File already exist.") End If Console.Read() End Sub Private Function CompareFiles(newFile As String, oldDirectory As String) As Boolean Dim newFileMD5 As String = HashMD5(newFile) Dim oldFiles() As String = Directory.GetFiles(oldDirectory, "*", SearchOption.AllDirectories) …

Member Avatar for renzlo
0
325
Member Avatar for violette

command.Parameters.AddWithValue("@stock_code", CType(e.Item.FindControl("stockCode"), Label)) You try to insert a Label in to your database? If not then change it to: command.Parameters.AddWithValue("@stock_code", CType(e.Item.FindControl("stockCode"), Label).Text)

Member Avatar for bluehangook629
0
158
Member Avatar for Quick2010

Use this code in your Form: [CODE=vb] Private Delegate Sub DelegateForSomeSub(ByVal arg0 As String) Public Sub SomeSub(ByVal arg0 As String) If Me.InvokeRequired Then Me.Invoke(New DelegateForSomeSub(AddressOf AppendText), arg0) Else AppendText(arg0) End If End Sub Private Sub AppendText(arg0 As String) TextBox1.AppendText(arg0) End Sub [/CODE]

Member Avatar for GeekByChoiCe
0
829
Member Avatar for ananth3125

Oh please .... don't ask for code if you don't show any effort first. Post what code you have so far and tell us where you stick. We are of course willing to help you but we are not going to code your stuff.

Member Avatar for ananth3125
0
145
Member Avatar for AndyPants

You need a TCP Client/Server. Take a look at this: Server: [url]http://msdn.microsoft.com/de-de/library/system.net.sockets.tcplistener.aspx[/url] Client: [url]http://msdn.microsoft.com/de-de/library/system.net.sockets.tcpclient(v=VS.100).aspx[/url]

Member Avatar for GeekByChoiCe
0
2K
Member Avatar for markdean.expres

execute your copy/move method in a separate thread. Set the max value of the progressbar to the original file filesize and update the progressbar to the copied file current size, using a timer.

Member Avatar for GeekByChoiCe
0
175
Member Avatar for akshayksh

[CODE=vb] Dim plain As String = "130790" If plain.Length <> 6 Then Throw New FormatException("wrong format. Please use DDMMYY") End If Dim _date1 As String = plain.Insert(2, ".").Insert(5, ".") Dim _date3 As Date = Date.Parse(_date1) Console.WriteLine(_date3) [/CODE]

Member Avatar for GeekByChoiCe
0
86
Member Avatar for AT--O

After closing a Form it does not exist anymore. Create a new instance of the form. Dim F as new Form2 F.Show

Member Avatar for AT--O
0
1K
Member Avatar for flywheeljack

FirstName:=FirstNameBox.Text << ok Original_FirstName1:=FirstNameBox.Text << that won't work out You hand over the "updated" values as original values. Those of course does not exist in the dataset.

Member Avatar for GeekByChoiCe
0
145
Member Avatar for pfm200586

[CODE=vb] Dim strOriginalWord As String = nothing Dim strPigLatin As String = nothing [/CODE] This will fix the green wavy line

Member Avatar for GeekByChoiCe
0
115
Member Avatar for weeraa

Try this: select * from (select Row_Number() over (order by [ID]) as RowIndex, * from [DB-Name].[dbo].[Table-Name]) as Sub Where Sub.RowIndex =10

Member Avatar for weeraa
0
158
Member Avatar for VB 2012

The easiest and savest way is this: [CODE=vb] Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click Dim tstan As TimeSpan If Not TimeSpan.TryParse(txtTime.Text, tstan) Then MsgBox("Please enter the time in format d:h:m:s") Return End If Timer1.Interval = 1000 Timer1.Start() End Sub Private Sub Timer1_Tick(sender As Object, e As …

Member Avatar for VB 2012
0
148
Member Avatar for acepeda

the simplest way would be to surround your retrieve code with [CODE=vb] Try 'retrieve code here Catch ex as InvalidCastException Debug.WriteLine("Value is DBNULL") 'set value to $0.00 End Try [/CODE]

Member Avatar for jireh
0
122
Member Avatar for RedexProGamma

Maybe that is what your are looking for: [CODE=vb]my.Computer.FileSystem.CopyDirectory("sourceDir", "destinationDir",false)[/CODE]

Member Avatar for codeorder
0
445
Member Avatar for carlt

The End.