419 Posted Topics
Re: You could accomplish your goal via Reflection something like this: private bool fred; public void SetBoolean(string boolToSet, bool Value) { System.Reflection.FieldInfo fi = this.GetType.GetField(boolToSet, Reflection.BindingFlags.Instance | Reflection.BindingFlags.NonPublic | Reflection.BindingFlags.Public); fi.SetValue(this, Value); } public void test() { SetBoolean("fred", true); } However, I would recommend that you consider using a Dictionary(Of String, … | |
Re: [String.Split Method](http://msdn.microsoft.com/en-us/library/system.string.split(v=vs.100).aspx) | |
Re: Assuming you have read the files into some string variables, you could do something like this: Dim AnswerKey() As Char = "TTFFTT".ToCharArray Dim StudentAnswers() As Char = "T-FFFT".ToCharArray Dim NumCorrect As Int32 = StudentAnswers.Where(Function(ans As Char, index As Int32) ans = AnswerKey(index)).Count Dim NumSkipped As Int32 = StudentAnswers.Where(Function(ans As Char, … | |
Re: Add a property to "infoEntry" to accept a reference to the ListView. private ListView _lv; public ListView lv { get { return _lv; } set { _lv = value; } } Then set that property before showing "dataWindow" dataWindow.lv = this.toSend; dataWindow.ShowDialog(); Then: ` lv.Items.Add("test").SubItems.AddRange(row1);` | |
| |
Re: Very confusing nomenclature! A form named timer1. What is on the form "timer1" other than a timer that closes it? Does the user interact with "timer1" while the creating form is executing the sendkeys code? SendKeys simulates keyboard input by placing the requested keys into the keyboard input stream. The … | |
Re: Hi staticclass, And welcome to the irritating world of trying to use transparency in WinForms! This may seem counter-intuitive, but instead of using the PictureBox Control, try using a Panel instead. Place your image as the BackgroundImage. Use the BackgroundImageLayout property as you would the PictureBox SizeMode Property. This will … | |
Re: This may help with the script errors issue. Set the "ScriptErrorsSuppressed" property on the WebBrowser control to True. That will prevent the error dialog from opening. | |
Re: Sub SetVisibility() Dim i As Int32 = 1 CType(Me.FindName("Button_" & i.ToString), Control).Visibility = Windows.Visibility.Hidden End Sub | |
Re: I'm not sure about how you select the image to place in "pBox", but I think this will give you the effect you are seeking. Private TrackedPB As PictureBox Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) _ Handles PictureBox1.MouseDown If e.Button = Windows.Forms.MouseButtons.Left Then ' Left Button … | |
Re: or, try [this](http://letmebingthatforyou.com/?q=msdn%20C%23%20tutorials). | |
Re: here is a pattern you can try. Dim dt As New DataTable With dt .Columns.Add("c1", GetType(String)) .Columns.Add("c2", GetType(String)) .Rows.Add(New Object() {"hi", "fred"}) .Rows.Add(New Object() {"hi", "barney"}) End With Dim SelectionField As String = "c2" Dim res() As DataRow = dt.Select("[" & SelectionField & "]='" & TextBox1.Text.Trim & "'") If res.Length … | |
Re: I realize you have marked this thread solved, but you do realize that your example is a valid date don't you? 2012 is a leap year, hence `IsDate(" February 29, 2012")` will return true. `IsDate("February 30, 2012")` would return false. | |
Re: Public Class ControlDirtyTrackerCollection Implements List(Of ControlDirtyTracker) End Class | |
Re: Lines 40 and 41 of your OP. Dim intNrStations As Integer 'Total number of station ReDim arrMicrosensor(intNrStations) The array "arrMicrosensor" has a length of 1 after these statements execute as "intNrStations" will have an initial value of zero. "`ReDim arrMicrosensor(intNrStations)"` is equivalent to: `ReDim arrMicrosensor(0 To 0)`; therefore, any array … | |
Re: Assuming all room numbers follow the pattern, [Number][Space][Letter], adding this class to your project this should do the trick. Friend Class PatientRoomComparer Implements IComparer(Of Patient) Public Function Compare(ByVal x As Patient, ByVal y As Patient) As Integer Implements System.Collections.Generic.IComparer(Of Patient).Compare ' For Ascending Order ' x < y : return … | |
Re: Possibly this is what you mean? Int32 i = 255; char c = (char)i; // or string s = new string(c,1); | |
Re: Hi lulu: The following example is for a WinForm, but I believe the charting control works the same for the a Web app. You need to first convert the Timespan to a datetime value to chart it, but I guess you already discovered that. ;) The problem then becomes one … | |
Re: I don't have the Microsoft.Office.Tools.Excel.dll so I can not test the get_Range function, but according to the documentation it returns a Microsoft.Office.Interop.Excel.Range. The Range object has the "Text" property that returns the as-displayed (formatted) text. | |
Re: BackgroundWorker? http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker%28v=vs.85%29.aspx | |
Re: I suggest that you use the MaskedTextBox control with an initial mask of "#-#######-#-#". Then in it's KeyPress Event handler: Private Sub MaskedTextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles MaskedTextBox1.KeyPress If MaskedTextBox1.SelectionStart = 12 Then If Char.IsLetter(e.KeyChar) Then e.KeyChar = Char.ToUpper(e.KeyChar) ' make it uppercase ' set mask … | |
Re: Another alternative is to use a common handler for all the checkboxes.checkchanged event and construct the string on each event. Private Sub CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) _ Handles CheckBox1.CheckedChanged, _ CheckBox2.CheckedChanged, _ CheckBox3.CheckedChanged Static Problems As New List(Of CheckBox) Dim cb As CheckBox = CType(sender, CheckBox) … | |
Re: See if this works for your needs: Private Function WeeksNumFromBasis(ByVal basis As DateTime, ByVal SubjectDate As DateTime) As Double Return SubjectDate.Subtract(basis).TotalDays / 7 End Function | |
Re: Take a look at your own post! If you plot 3 series each with 5 points, you get 5 columns with 3 points in each column. **Notice the relation detween the number of points and the number of columns as well as the relation between number of series and number … | |
Re: You are attempting to use the SQLDataReader class, did it occur to you to to look at the documentation. http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqldatareader%28v=vs.100%29.aspx It gives a basic example of how to implement it. | |
Re: I am a bit confused about which control you want to monitor (DGV vs EditControl). If it is for the DGV and the arrow-up and arrow-down keys, then try using the DGV.KeyDown event. | |
Re: Sorry, but our required compliance with the guidelines of the National Organization for Computer Homework Excellence Authorization Treaty prevents us from providing you the information you are requesting. | |
Re: If you have retrieved the dataset, you can write the schema to a file. Dim s As IO.Stream = IO.File.OpenWrite("Unknown.xsd") UnknownDataSet.WriteXmlSchema(s) s.Close() After running this code, go to visual studio, and from the Project Menu, select add existing item and add "Unknown.xsd". Then from the Solution Explorer, right-click on Unknow.xsd … | |
Re: Do you have the C# Code? If so, you could reconfigure it as class library and call the download method. If not, there are two options: 1) Process.WaitForExit and 2) The Process.Exit event. http://msdn.microsoft.com/en-us/library/fb4aw7b8.aspx http://msdn.microsoft.com/en-us/library/system.diagnostics.process.exited.aspx | |
Re: I don't know C++, but it appears as though the structure packs to values into a single Int64 value. if this is the case, try reading the value as a Int64 and masking and bit shifting to get the values. Int64 val = 978086288751L; Int64 ean = default(Int64); Int64 rec_no … | |
Re: If there is no space after the final comma, setting the RemoveEmptyEntries option should work. Here is an example: Dim s As String = "1,2,3,4,5," Dim parts() As String = s.Split(","c) Stop ' will yield 6 entries parts = s.Split(New Char() {","c}, StringSplitOptions.RemoveEmptyEntries) Stop ' will yield 5 entries ' … | |
Re: > thank you sir but is there any other solutions? beside your suggestions? What is it that you find unacceptable about the solutions proposed thus far? | |
Re: Next time you have the urge to make a post similar to this, try sites like these: https://www.elance.com/p/lpg/programming/coders?rid=22HUR&utm_source=bing&utm_medium=cpc&utm_campaign=Programming&utm_term=rent%20coder&ad=1063576178&mt=e&qs=rent%20a%20coder&bmt=be http://www.vworker.com/ | |
Re: See my last post in this thread: http://www.daniweb.com/software-development/vbnet/threads/427999/how-to-change-custom-cursor-when-form-load | |
Re: Both OleDb and Sqlclient classes inherit from base classes in System.Data.Common, so you can assign the specific type to the parent type. This quick test worked fine for me. Dim applicType As String = "AccessDatabase" 'I just intitialized the objects to get rid of the annoying IDE messages Dim conn … | |
Re: It would help if you showed your code. Also would help if you identified the line of code that throws the error. | |
Re: **Logic Error** If PathRead() = 0 Then MsgBox("Error Reading Path Info: One or more Paths do not exist.", MsgBoxStyle.Critical, "Path Read Error") MsgBox("Would you like to create these files?", MsgBoxStyle.YesNo, "Create?") If MsgBoxResult.Yes Then MkDir("/Paths/") System.IO.File.Create("/Paths/aPath.txt") System.IO.File.Create("/Paths/mPath.txt") System.IO.File.Create("/Paths/lPath.txt") System.IO.File.Create("/Paths/wPath.txt") End If End If Should be: If PathRead() = 0 Then … | |
Re: So you are maintaining two lists; one for the words and the second to to strore the number of occurence of that word. Why not use the dictionary class as was previously suggested by ddanbe? It has all the functionallity you require already built-in. `private Dictionary<string, Int32> words = new … | |
Re: I think this: cmd.CommandText = "select last_name, first_name, middle_name from tenant where last_name = '" & Me.ComboBox1.Text & "' AND first_name = '" & Me.ComboBox2.Text & " AND middle_name" & Me.ComboBox3.Text & "'" should be cmd.CommandText = "select last_name, first_name, middle_name from tenant where last_name = '" & Me.ComboBox1.Text & … | |
Re: How was the photo saved to Access? Was it written as a BLOB by a program you wrote or was is it added In MS Access 2007 or newer as an attachment? | |
Re: Performing computions on TimeSpan and DateTime types are two areas that the DataTable class does not support very well. That said, you are left to process the rows yourself in code. Here are two options, both of which entail creating an array of resultant rows that can then be added … | |
Re: The ommision of ByVal is a non-optional "feature" MS added in VB2010 SP1. ByVal is the default parameter passage mechanism in .Net. Supposedly MS originally used the placement of ByVal as a reminder for those migrating from VB6 where ByRef is default. | |
Re: You are adding parameters that may not exist in the command string. > INSERT INTO [Customer] (Company, Business_Phone, Home_Phone, Mobile_Phone, Fax) VALUES (@CMPNY, @BUSPH, @HOMPH, @MBLPH, @FAXNM) In this case you will have parameters for Last_Name and First_Name that are empty. I believe that the parameters must be in the … | |
Re: > IsDigit code will allow to enter everything apart from digits.... So put "Not" in front of it. `If Not Char.IsDigit(e.KeyChar) Then` The "Char.XXx" functions will account for regional language settings that use unicode characters outside the range of those used for English letters. | |
Re: Hiba, No offense intended, but the DataGridView control is really intended as a viewer for data in a tabular format and not as a spreadsheet. It would be better to handle these calculations in the backing data storage. Even if the data is not pulled from a database, it is … | |
Re: This article gives a decent overview. http://www.codeproject.com/Articles/154121/Using-Try-Catch-Finally | |
Re: You may want to review this article. http://www.codeproject.com/Articles/3467/Arrays-UNDOCUMENTED I also remebered reading somewhere that the outermost dimension should be iterated before the inner ones. If I recall correctly, it has something to do with the layout in memory, but don't quote me on that. I ran a test case of … | |
Re: Have you installed Service Pack 1? The base install has a lot of issues corrected by the service pack. http://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=13276 | |
Re: The richtextbox uses chr(10) (VBLf) to designate a new line. So if that is working, then check for VBLf (this is a VB character constant). On non-Unix systems, the System.Environment.NewLine is a two character string equivalent to chr(13) & chr(10). You could also use the VB constant VBCrLf for this. … | |
Re: kRod, First off, GREAT JOB!!!!! Two minor things in your code. 1. You declare and set "maxSize", but it is never used in your logic. Just delete all references to it. 2. You use GetNextControl. This is a tricky function to use and I wish MS would reroute people to … |
The End.