419 Posted Topics
Re: You are on the right track by acknowledging that you need to learn how to do this versus the all to common "I want code that does this and I have no intention of ever understanding it". This site is an excellent starting point. [Visual Basic .NET Programming for Beginners](http://www.homeandlearn.co.uk/net/vbnet.html) … | |
Re: Presumably you have a table in the report and the cell expression is currently something like: `=Fields!ColumnC.Value` Use the Replace function to replace the comma, `=Replace(Fields!ColumnC.Value, ",", VBCrLf & "-")` | |
Re: [DataTable.Compute Method](http://msdn.microsoft.com/en-us/library/system.data.datatable.compute.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-1) | |
Re: Have you some how set the MaximumSize property to something other than Size.Empty? | |
Re: That is not a question, that is a specification. As stated above, show what you have tried and described what is giving you problems. | |
Re: I'm not going to claim that this is a better way, but it is one way that I find easy to read and work with. ' This method uses a CopmmandBuilder to build the commands ' You need to provide a DataApater with the select command defined ' for the … | |
Re: There is a more complete example here: [http://msdn.microsoft.com/en-us/library/system.diagnostics.process.beginoutputreadline%28v=vs.90%29.aspx](http://msdn.microsoft.com/en-us/library/system.diagnostics.process.beginoutputreadline%28v=vs.90%29.aspx) Other than that follow tinstaffl advice. | |
Re: > So a work associate told my that if I add the Microsoft Word Object Library to my reference a user would be able to strip the word document text and process the data as a new string. It seems I was misinformed. There is no way my company is … | |
Re: @moodylv: You are in the wrong forum. That is VB.Net code. I will ask a moderator to move this. For future reference, this is the correct forum: http://www.daniweb.com/software-development/vbnet/58 Take a look at this article: [How to: Read From Comma-Delimited Text Files in Visual Basic](http://msdn.microsoft.com/en-us/library/cakac7e6%28v=vs.90%29.aspx) In the example change: MyReader.TextFieldType = … | |
Re: I don't know about using LINQ for this, but I would do it like this. using System.Xml; . . . XmlDocument doc = new XmlDocument(); doc.Load("source.xml"); // if you have the xml in a string use doc.LoadXml(stringvar) XmlNamespaceManager nsmngr = new XmlNamespaceManager(doc.NameTable); XmlNodeList results = doc.DocumentElement.SelectNodes("child::result", nsmngr); foreach (XmlNode result … | |
Re: Edit: @Jim, sorry about this. Didn't mean to step on your toes. I got interrupted while posting and did not think to do a refresh before posting. ********** No offence intended, but the logic of yours is very confusing. I'm not sure that this is much better. It does pretty … | |
Re: I am interpreting the OP's question to be how to disable those annoying navigation clicks. This looks like much more code than it really is as I just cut it out of my browser class with all the included documentation. Public Class Form1 'Disables Navigation Sound Private Sub btnMuteNav_Click(ByVal sender … | |
Re: A Datetime variable holds no culture specific information. You can however create a string representation for a specific culture. I'm a bit lost as to whether you are trying to convert a string value from your service or convert to string value to send to your service. Here are some … | |
Re: try following this pattern instead, Dim dt As New DataTable Dim r As DataRow '************************* ' simulate Database Load With dt .Columns.Add("FromDataBase", GetType(Double)) r = .NewRow : r(0) = 5 : .Rows.Add(r) r = .NewRow : r(0) = 15 : .Rows.Add(r) r = .NewRow : r(0) = 25 : .Rows.Add(r) … | |
![]() | Re: For another method see: [Extending the My Namespace in Visual Basic](http://msdn.microsoft.com/en-us/library/bb531245%28v=vs.110%29.aspx) ![]() |
Re: Random is a pseudoRandom generator. You are creating a new instance each time. Without checking the docs, I believe it seeds based on system time. Therefore your seed value on differs only a bit on each creation. Try this: Private rnd As New Random Private Sub Me_Load(ByVal sender As Object, … | |
Re: > I've also done something with tab controls before and hooking into the draw at run time to hide the actual tabs showing, then programatically hopping between the two This works well if you want to keep all the controls and their handlers under one form. The method I use … | |
Re: @Andre, did you by chance mean to use InstrRev in line 6 of your code? Here's my entry for this mundane function. Function RemoveExt(fname As String, Optional extToRemove As String = "") As String ' if extToRemove = "" then all extensions removed Dim pt_pos As Integer pt_pos = InStrRev(fname, … | |
Re: Here is another option using the FileSystemObject Sub ListDrives() Dim fso As Scripting.FileSystemObject 'needs refernce to: Microsoft Scripting Runtime Dim fsoDrives As Scripting.drives Set fso = New FileSystemObject Set fsoDrives = fso.drives Dim i As Integer Dim letter As String Dim driveType As String For i = Asc("A") To Asc("Z") … | |
Re: Here is my 2 cents worth for something to check. You mention 64-bit repeatedly. Are you trying to target 64 bit? One of the DLL's may be 32-bit only. I believe that it would run fine under VS as VS is a 32-bit app. | |
![]() | Re: Are you using the Visual Basic source code editor to enter your code? If so, try paying attention to the IntelliSence prompts.  It informs you that you need to specify the column to retrieve for the GetString method. |
Re: Is the button a Microsoft Forms 2.0 Object Library CommandButton that has a TakeFocusOnClick property? If so, try setting the property to false. | |
Re: To make that work you need to have Option Strict Off which is something I personally do not care for, but to each their own. You are forcing a narrowing implicit conversion on the method signature (delegate). Based on [Variance in Delegates (C# and Visual Basic)](http://msdn.microsoft.com/en-us/library/dd233060%28v=VS.100%29.aspx) I believe you are … | |
Re: You played that " I'm just a student starting to learn vb.net and more on searching codes for editing and applying to my app" 3 momths ago. Instead of looking for code to cobble together into something that satifies your instructor, try learning from what you find. If you don't … | |
Re: Err is in this line: `g.Graphics.FillRectangle(tBrushArray(imageID), tJunk(a))` Many of the elements (indices: 0, and 9 thru 19) in tBrushArray are set to Nothing (null). So if imageID equals one of those indices, you are passing a null (VB Nothing) brush like your error message indicates is the problem. | |
Re: Please show a sample of your original xml file. Then manually create and show a sample of how it should look after it has been sorted. | |
![]() | Re: Just a bit of info to add to the discussion. Your original code will give you your expected result if you change `objWriter.Write(editor.RichTextBox1.Text)` to `objWriter.Write(editor.RichTextBox1.Rtf)` Those dang computers always try to do what you tell them to do, not what you want them to do. :) That said, its easier … |
Re: I guess if you you have it formatted to a short date format, then allowing the user to invoke the dropdown to show the MonthCalndar may be of some use. Anyways, making a readonly DTP control is fairly easy. Public Class ReadOnlyDTP Inherits DateTimePicker Public Shadows Property Value() As DateTime … | |
Re: To supplement BD's comment on brackets, this is from the documentation; *Any program element — such as a variable, class, or member — can have the same name as a restricted keyword. For example, you can create a variable named Loop. However, to refer to your version of it — … | |
Re: Is the DGV bound to a datatable? Can you except the DGV showing only rows that match your search criteria? If so, consider using setting the row filter on the datatable's DefaultView or creating a DataView and using it as the DGV's datasource. | |
Re: Is this happening with all your projects or just one particular project? Does it happen if you create a new project? | |
Re: You are either going to have to transform your table into format that databinding can read, or feed the points individually by looping through your table. Since you are using timespans, you will have to transform the timespan to a numeric value. You have been shown before how to do … | |
Re: This behavior can occur if your source file (yourfilename.vb) somehow become posted dated in comparison to your current system datetime setting. I posted some instructions on how to correct this condition here: [Click Here](http://www.daniweb.com/software-development/vbnet/threads/442525/vb.net-does-not-work-properly#post1908265) | |
![]() | Re: I believe you are getting the error due to your use of "+" for string concatonation. Since you have a numerical value (cmbSecurity_Ques.SelectedIndex) in your code, the compiler is treating all of it as a mathematical equation. Switch to using "&" and change: `cmbSecurity_Ques.SelectedIndex` to: `cmbSecurity_Ques.SelectedIndex.ToString` ![]() |
![]() | Re: Be advised that setting the class style to CS_NOCLOSE (named CP_NOCLOSE_BUTTON in Doogledude's example) will also prevent Alt-F4 from closing the window. You can achieve the same effect while retaining Alt-F4 closure by PInvoking the RemoveMenu function. Private Const MF_BYCOMMAND As Integer = 0 <DllImport("User32")> _ Private Shared Function RemoveMenu(ByVal … ![]() |
Re: You need an ExpandableObjectConverter. It's pretty easy to do. :) Here is the converter: Public Class DatabasePropertiesConverter Inherits ExpandableObjectConverter Public Overrides Function ConvertTo(ByVal context As ITypeDescriptorContext, ByVal culture As Globalization.CultureInfo, ByVal value As Object, ByVal destinationType As Type) As Object If destinationType Is GetType(String) Then Return "" ' this prevents … | |
Re: > I can't find "Controls.InvokeRequired" in vb.net2003. I want to write a simple data updating from "Mulitple Thread", but I would like to check whether "Controls" are requied "Invoke" or not. I can't say for certain as I never worked with Visual Basic .Net 2003 or the 1.1 .Net Framework, … | |
Re: Jim has a minor error in his code: "SELECT * FROM invoiced_filter " & _ " WHERE (Invoiced > #" & fromdte & "# AND Invoiced < #" & todte & "#)" Access also supports the Between statement but it requires the hash mark ("#") as Jim shown. "SELECT * … | |
Re: For you first question regarding Process. "Process.Start" is a shared function that returns the started process. The correct syntax would be: Dim NewProcess As Process ' No New keyword If Attachment2TextBox.Text <> "" Then NewProcess = Process.Start(Attachment2TextBox.Text) For you second question, I am not going to re-invent the wheel, but … | |
Re: Perhaps use a checkbox with a button appearance instead? Public Class Form1 Private WithEvents chkButton As New CheckBox _ With {.Appearance = Appearance.Button, _ .CheckState = CheckState.Unchecked, _ .Location = New Point(10, 10), _ .Size = New Size(150, 25), _ .TextAlign = ContentAlignment.MiddleCenter, _ .Text = "I'm really a checkbox", … | |
Re: I looked at your previous thread and the advice you were given should have worked if it was implemented correctly. So, please show your actual code where you define your Select query. This should be easy to correct for you if we have the relevant information. Also, what type of … | |
Re: Are you using VS2012 Express, if so you may be out of luck. [Click Here](http://forums.mysql.com/read.php?38,546265,570091#msg-570091) | |
Re: The option that I prefer is to extend the "My" namespace. It is designed just for this type of use. I assumed that the config file only would need to be read once. If this is not the case you can easily modify the logic. Just add this like you … | |
Re: I am bored and decided to go into a tutor mode. :) First off I believe in strongly typed data, so I recommend that you use an Ingredient class. Public Class Ingredient ''' <summary> ''' Builds a new ingredient from a comma delimited source string ''' </summary> ''' <param name="Source">ex: … | |
Re: I think this pattern should work for you. I'm still learning this XML stuff. ' create a named datatable ' content is irrelevant Dim dt As New DataTable("fredsfamily") Dim r As DataRow With dt .Columns.Add("Name") r = .NewRow : r(0) = "wilma" : .Rows.Add(r) r = .NewRow : r(0) = … | |
Re: Perhaps using a TimeSpan instead of a DateTime will give you the effect you are looking for? Public Class Form1 Private WithEvents tmCountDown As New System.Windows.Forms.Timer With {.Interval = 1000} Private tsStartTime As TimeSpan Private lblCountDown As New Label With {.Location = New Point(10, 10), _ .AutoSize = True, _ … | |
Re: > Now while adding each row,if database have value for caste field,combobox should show that value as default value else no default value should be selected.Thanks in advance. So if the database value is null (no value set), you want the combobox to reflect this by not selecting one of … | |
Re: Perhaps something like this: ' Since all your items are then same, create a list to use as a common DataSource for each ComboBox Dim items() As String = {"Sample 1", "Sample 2", "Sample 3", "Sample 4"} Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Since … | |
Re: Here is one way to handle it. Add a "Moved" (type Boolean) to the underlying datatable and create to dataviews to act as the datasource for the respective datagridviews. Public Class Form1 Private ds As New DataSet Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ' … | |
Re: I'm not sure I understand your situation correctly, but UI controls must be manipulated only on the thread that created them. Here is an example that flashes Form2. Note the pattern used with the InvokeRequired. Public Class Form1 Private WithEvents bgw As New System.ComponentModel.BackgroundWorker With {.WorkerSupportsCancellation = True} Private Sub … |
The End.