419 Posted Topics
Re: At the top of your code type this: `Option Strict On` Better yet, on the menu got Tools->Options. Expand the "Projects and Solutions" node. Select "VB Defaults" and turn it on there. This will allow Visual Studio to point you to many mistakes in your code. Look at this line: … | |
Re: Class MainWindow Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Button1.Click Dim Other As New Window1(TextBox1) Other.Show() End Sub End Class Public Class Window1 Private DestTB As TextBox Public Sub New(ByVal DestTB As TextBox) InitializeComponent() Me.DestTB = sourceTB End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal … | |
Re: Just food for thought, but why not impliment the API function CopyFileEx? http://msdn.microsoft.com/en-us/library/windows/desktop/aa363852%28v=vs.85%29.aspx PInvoke.Net has an example. http://www.pinvoke.net/default.aspx/kernel32/CopyFileEx.html This function gives you the relative safety of using a standard Windows library function along with the file progress reporting capability that you want. | |
Re: > Now when I type something in textbox1 and lose focus, textbox2 is altered but when I click the button neither textbox is updated. > >Obviously if I uncomment the call to notifyPropertyChanged all works fine. This however brings up questions in my mind. > >1. If I change textfield1 … | |
Re: I recommend that you create a BindingNavigator to manage navigation. Your current implimentation has no error checking and the navigator will do all that for you. http://msdn.microsoft.com/en-us/library/system.windows.forms.bindingnavigator(v=vs.90).aspx With a navigator you can define the buttons that handle navigation. The one draw back is that they need to be ToolStrip items. … | |
Re: How did you add the files? Are they in an external assembly? If you added them via Project-.Properties and the "Resources" tab and you know the name, there is no need to enumerate through the entries. You can just access using "My.Resources.NameYouWant". | |
Re: I am forced to conclude by the syntax "getcomments()" that getcomments is a function that returns an ArrayList. Howerver without seeing that function it is not possible offer any insite as to why this is happening. | |
Re: > Here is what the source will look like: > text1 = text1 > text2 = text2 > text3 = text3 > text4 = text4 > text5 = abcdefg (Yes) > text6 = hijklmn (Yes) > text7 = 1234567 (No) > text8 = abcdefg (No) > >What I want to … | |
Re: You lost me on your sequence of events. However, the simplest way to store the textbox is to use "UserSettings". Go to Project->Properties and select the Settings tab. Create three setting like these:  Then in your notepad form do something like this: Private Sub btnSave_Click(ByVal sender As System.Object, … | |
Re: Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress If Not Char.IsLetterOrDigit(e.KeyChar) Then e.Handled = True End If End Sub | |
Re: Add a constructor to the form (call it Form2) that needs to hide the button on the first form (call it Form1). Like this: Public Class Form2 Private ButtonToHide As Button Public Sub New(ByVal ButtonToHide As Button) Me.InitializeComponent() Me.ButtonToHide = ButtonToHide End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal … | |
Re: Take a look at this [article](http://www.codeproject.com/Articles/28209/Outlook-Drag-and-Drop-in-C#). It's in C#, but you should be able to follow the methodology. If you have problems understanding it, feel free to ask questions here. I have implement his methods in a project of mine, so I have a basic understanding of what it is … | |
Re: Two things standout as big performance hits: 1) string concatenation: This is very slow and gets worse as the length of the string grows. Your "Display" variable gets longer as the loop progresses. 2) unnecessary assignment statements in the loop: The big one is assigning TextBox1.Text. Since you have not … | |
Re: There should not be a box behide the picture box. Are you sure that you do not have a image smaller than the size of the picturebox and that the PictureBox.SizeMode is not set to centerimage? Try setting the size mode to "Zoom" and see if the box goes away. | |
Re: VB2005 has VB6 converter built-in. For simple projects it can be a time saver. As the others have stated, the converted source can be more work than starting from scratch. Here are download links for VB2005. Visual Basic 2005 Express Edition (445,282 KB) * IMG File: http://go.microsoft.com/fwlink/?linkid=54764 * ISO File: … | |
Re: The DLLImportAttribute is used to import a specific function from a native library. It does not import the entire library. You need the documentation for the function to define the signature properly. For imports from Microsoft Windows API's see [http://www.pinvoke.net/](http://www.pinvoke.net/). A quick websearch on beidlib.dll leads me to believe that … | |
Re: > VB.net should be able to handle this although you may have to use parenthesis: If (0<= a <=100) then AND, ANDALSO, OR and ORELSE are used for testing two conditions but "0<=a<=100" is one logical condition This will compile and run if "Option Strict" is off (one of the … | |
Re: You may want to take a look at this HTML Render. [http://www.codeproject.com/Articles/32376/A-Professional-HTML-Renderer-You-Will-Use](http://www.codeproject.com/Articles/32376/A-Professional-HTML-Renderer-You-Will-Use) You can use it to render HTML to an bitmap then save the bitmap. | |
Re: To be honest, I got a little confused by your logic. Therefore I thought I would post this example. It is similar to yours and maybe you can use it to find the problem in your code. string path = Application.StartupPath + "\\songs.txt"; System.IO.Stream strmSongs = System.IO.File.OpenRead(path); System.IO.StreamReader sr = … | |
Re: Sometimes the designer gets messed up and exiting and restarting clears it up. Best to make sure the Form's Design view is closed before restarting. In the worst case you may have to edit the Form.designer.vb file and make sure that the controls are added to the proper tabpage. If … | |
Re: Unfortunately, Access does not support the DateName function. However, you can get the same functionality from the "FORMAT" function. Dim conn As New OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='" & "D:\My Documents\temp\Play.mdb" & "'") Dim cmd As New OleDb.OleDbCommand() cmd.Connection = conn TextBox1.Text = "ma" cmd.CommandText = "SELECT *, FORMAT([DateEntered], 'MMMM') as [Month] FROM … | |
Re: You have not assigned the connection to "OComn" (OleCoDbCommand). see: [http://msdn.microsoft.com/en-us/library/system.data.oledb.oledbconnection%28v=vs.90%29.aspx](http://msdn.microsoft.com/en-us/library/system.data.oledb.oledbconnection%28v=vs.90%29.aspx) | |
Re: > What I want to have is the inverted output e.g. binary output converted from 000010001000011 (abc) to 000110001000001 (cba). For i = 0 To stringlength - 1 If c = "0" Then convertdata = "00000" .... rest of your code Should be something like this: Dim stringlength as Int32 … | |
Re: try here: [http://raptorflowchart.freeforums.org/](http://raptorflowchart.freeforums.org/) | |
Re: You did not mention what tutorial you are following. However, I have found this site to be very good, if at times dated, for learning the basics. [http://www.homeandlearn.co.uk/NET/vbNet.html](http://www.homeandlearn.co.uk/NET/vbNet.html) It would also be helpful if you posted a screen shot of your database definition. From the code you posted, you have … | |
Re: Personally, I prefer to prevent the user from having such entry options. It makes the subsequent coding much easier. It is easy enough to write custom entry controls that inherit from those supplied in .Net. I have assumed that you want to be able to enter N=North, S=South, E=East, W=West … | |
Re: Take a look at [this article](http://www.codeproject.com/script/Articles/ViewDownloads.aspx?aid=27346). | |
Re: A BindingSource also has a "Sort" property. I have not investigated the actual logic for this, but if the bindingsource.sort property is set to an empty string, the behaviour your are seeing will occur. If you set bindingsource.Sort to null before assigning the "DataSource", it will not clear the DefaultView.Sort … | |
Re: Sandy, First off, change the password on that account immediately and cancel your credit card. I know very little about this topic, but: Dim em1 As HtmlElement = wb1.Document.All("emailAddress") 'returns ID: "login-Email_Address" Dim pw As HtmlElement = wb1.Document.All("password") 'returns ID: "login-password" These are not the ID's you wanted. This does … | |
Re: I would suggest that you place your logic in the PlayStateChange event handler. Here is a snippet from a program of mine. Sub WMP1_PlayStateChange(ByVal sender As Object, _ ByVal e As AxWMPLib._WMPOCXEvents_PlayStateChangeEvent) _ Handles wmp1.PlayStateChange Select Case e.newState Case WMPLib.WMPPlayState.wmppsUndefined currentStateLabel.Text = "Undefined" Case WMPLib.WMPPlayState.wmppsStopped currentStateLabel.Text = "Stopped" Case WMPLib.WMPPlayState.wmppsPaused … | |
Re: The Form.Close method does exactly that; it tells the form to close. It does not stop the currently executing code block. The following code will demonstrate this behavior and show you an alternative to achieve your goal of stoping execution. Just step through the code in the debugger to observe … | |
Re: I'm not sure that I understand what it is that you mean by "own session" If you mean that you want to merge the two datatables together so that they can be displayed in the same DataGridView control, then you would use the [DataTable.Merge](http://msdn.microsoft.com/en-us/library/system.data.datatable.merge.aspx) method. Perform the merge in your … | |
Re: You are not clearing MyDataTable before filling in CnScrip. Try adding MyDataTable.Clear before MyAdapter.Fill(MyDataTable). | |
Re: Hi Dave, I suggest that you either type "Option Strict On" as the first line in your code or enable as the default state under "Options->Projects and Solutions->VB Defaults". This will force VS to flag improper type conversions. It may seem like a pain at first, but you will find … | |
Re: Nutster, you may find this article helpful: [Click Here](http://www.codeproject.com/Articles/154121/Using-Try-Catch-Finally) The code placed under the "Finally" section can be viewed like an in-place method definition that will always be called before leaving the "Try-End Try" block. Let's say in your IOException example, that you can not recover from the file error … | |
Re: Usually, the best place to start is to get the [manual](http://download.gigabyte.us/FileList/Manual/motherboard_manual_8i945p(pro)(-g)_e.pdf). From the manual page 59. A. What is Dual BIOS Technology ? Dual BIOS means that there are two system BIOS (ROM) on the motherboard, one is the Main BIOS and the other is Backup BIOS. Under the normal … | |
Re: If you are not limiting the allowable characters in the textbox to exclude characters that the "LIKE" statement uses, you should preprocess the textbox's text to bracket those characters similar to like what I have shown in my example. I believe the SQL "LIKE" command treats these as special characters: … | |
Re: FoxPro uses a variant of the old dBase([Click Here](http://en.wikipedia.org/wiki/Dbase)) file format. There is a program (free trial) called DBF Manager that works well with these file types. You can find it here: [Click Here](http://www.astersoft.com/) | |
Re: Hi Minko, You did not show how you defined your array so I had to guess. If you have a one dimensional array you can use the Array.Sort method. I defined a class to hold you data and made an array of those data items. Since the array holds a … | |
Re: The problem is caused by: ListBox1.Items.RemoveAt(ListBox1.SelectedIndex) When you remove the item, there is nothing selected and SelectedIndex = -1. That explains the error, but I have a feeling that your program logic may not be correct. Is the listbox used to select the meals or is it selected by the … | |
Re: Another option is to use the Linq extensions on the array class. For example: Dim A() As String = {"a", "b", "c", "d", "e"} Dim B() As String = {"a", "g", "c", "h", "k"} Dim InA_notIn_B() As String = A.Except(B).ToArray 'yields: b, d, e Dim InB_notIn_A() As String = B.Except(A).ToArray … | |
Re: Guys, this has nothing to do with nulls being returned from the database. It has to to do with the DataTable.Compute method returning a DBNull.Value when as the OP stated that the filter criteria does not match any records in the datatable. Replace the textbox.text assigment statement with: Dim o … | |
Re: Sean, Before I even attempt to offer advice on this I want to make sure we have the goals well defined. So here is how I have distilled your description. Form1 contains: datagridview Form2 contains: multiple textboxes and a "Send Button" On clicking "Send", the contents of the textboxes are … | |
Re: Most of your needs are pretty straight forward. The adding a button one is the stickler. I've hosted other apps in a winform before, so I thought why not follow the same method to host a winform button in another app? It sort of works ok. You need to control … | |
Re: Isn't the correct syntax: System.IO.File.AppendAllText(filepath, strToAppend) not: System.IO.File.AppendAllText(strToAppend)? | |
Re: > When the database doesn't have a password, it works perfectly. But when I give it a password ("OpenSesame") and change the Connect string to "Access;pwd=OpenSesame", I get this error: > "Couldn't find installable ISAM." I am probably wrong on this, but shouldn't the connection string be: "dns=Access;pwd=OpenSesame"? | |
Re: > As a matter of interest, do you know if there is a way to do a similar query on a dataset using LINQ? You would have to run Linq against the DataTable.Rows collection. You could also use the DataTable.Compute method for a non-Linq solution. Dim dt As New DataTable … | |
![]() | Re: Assuming that the datagridview is bound to a datatable, then you can use the DataTable.Compute method. `Dim total As Decimal = CDec(dt.Compute("Sum([Payments])", "True"))` Where "dt" is the name of the datatable. I assumed that the column name in the datatable for "paymenents" is "Paymenents". |
Re: Assuming this is the code that you are using to write the file (found in your other thread), Private Sub WriteAccounts(filename As String, Accounts As List(Of Account)) Dim lines As String = "" For Each acct As Account In Accounts lines &= acct.ToString() & vbCrLf Next System.IO.File.WriteAllText(filename, lines) End Sub … |
The End.