419 Posted Topics

Member Avatar for //Gonz

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, …

Member Avatar for //Gonz
0
250
Member Avatar for salford6129

[String.Split Method](http://msdn.microsoft.com/en-us/library/system.string.split(v=vs.100).aspx)

Member Avatar for TnTinMN
0
152
Member Avatar for vbenthu

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, …

Member Avatar for vbenthu
0
107
Member Avatar for tet3828

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);`

Member Avatar for TnTinMN
0
424
Member Avatar for anisha.silva
Member Avatar for Ray124

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 …

Member Avatar for TnTinMN
0
128
Member Avatar for staticclass

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 …

Member Avatar for TnTinMN
0
244
Member Avatar for Stuugie

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.

Member Avatar for Stuugie
0
533
Member Avatar for hadas.beja

Sub SetVisibility() Dim i As Int32 = 1 CType(Me.FindName("Button_" & i.ToString), Control).Visibility = Windows.Visibility.Hidden End Sub

Member Avatar for hadas.beja
0
157
Member Avatar for Doogledude123

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 …

Member Avatar for TnTinMN
0
651
Member Avatar for zee89

or, try [this](http://letmebingthatforyou.com/?q=msdn%20C%23%20tutorials).

Member Avatar for TnTinMN
0
91
Member Avatar for tinu28

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 …

Member Avatar for TnTinMN
0
106
Member Avatar for renzlo

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.

Member Avatar for Reverend Jim
0
222
Member Avatar for lion8420

Public Class ControlDirtyTrackerCollection Implements List(Of ControlDirtyTracker) End Class

Member Avatar for TnTinMN
0
203
Member Avatar for yat862

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 …

Member Avatar for AndreRet
0
2K
Member Avatar for DelilahDemented

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 …

Member Avatar for DelilahDemented
0
195
Member Avatar for andutzicus

Possibly this is what you mean? Int32 i = 255; char c = (char)i; // or string s = new string(c,1);

Member Avatar for andutzicus
0
106
Member Avatar for lulu79

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 …

Member Avatar for lulu79
0
2K
Member Avatar for wallstr33t

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.

Member Avatar for wallstr33t
0
555
Member Avatar for A0110

BackgroundWorker? http://msdn.microsoft.com/en-us/library/system.componentmodel.backgroundworker%28v=vs.85%29.aspx

Member Avatar for A0110
0
178
Member Avatar for veeeeebeeeee

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 …

Member Avatar for TnTinMN
0
305
Member Avatar for roemerito

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) …

Member Avatar for roemerito
0
2K
Member Avatar for ranga.seeman

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

Member Avatar for ranga.seeman
0
1K
Member Avatar for Renga

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 …

Member Avatar for Renga
0
386
Member Avatar for guillier

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.

Member Avatar for guillier
0
127
Member Avatar for Majestics

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.

Member Avatar for TnTinMN
0
173
Member Avatar for mcmanuel20

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.

Member Avatar for mcmanuel20
0
106
Member Avatar for thewilf

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 …

Member Avatar for TnTinMN
0
195
Member Avatar for Wolxhound90

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

Member Avatar for Wolxhound90
0
93
Member Avatar for kisetsukee

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 …

Member Avatar for TnTinMN
0
418
Member Avatar for ct_hunny

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 ' …

Member Avatar for Reverend Jim
0
3K
Member Avatar for jontennyeah

> 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?

Member Avatar for G_Waddell
0
434
Member Avatar for singh.ranjeet

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/

Member Avatar for TnTinMN
0
146
Member Avatar for xtianpark

See my last post in this thread: http://www.daniweb.com/software-development/vbnet/threads/427999/how-to-change-custom-cursor-when-form-load

Member Avatar for TnTinMN
0
352
Member Avatar for waleed.makarem

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 …

Member Avatar for waleed.makarem
0
599
Member Avatar for anisha.silva

It would help if you showed your code. Also would help if you identified the line of code that throws the error.

Member Avatar for anisha.silva
0
1K
Member Avatar for Doogledude123

**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 …

Member Avatar for TnTinMN
0
189
Member Avatar for anisha.silva

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 …

Member Avatar for anisha.silva
0
233
Member Avatar for ms061210

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 & …

Member Avatar for ms061210
0
158
Member Avatar for vistamizer101

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?

Member Avatar for TnTinMN
0
381
Member Avatar for lulu79

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 …

Member Avatar for lulu79
0
9K
Member Avatar for linabeb

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.

Member Avatar for linabeb
0
121
Member Avatar for cmstoner

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 …

Member Avatar for cmstoner
0
841
Member Avatar for nIcks123

> 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.

Member Avatar for Reverend Jim
0
206
Member Avatar for HibaPro

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 …

Member Avatar for HibaPro
0
620
Member Avatar for ome2012

This article gives a decent overview. http://www.codeproject.com/Articles/154121/Using-Try-Catch-Finally

Member Avatar for ome2012
0
203
Member Avatar for ImagingMachine

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 …

Member Avatar for Momerath
0
539
Member Avatar for Ctechnology24

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

Member Avatar for TnTinMN
0
127
Member Avatar for Sahil89

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. …

Member Avatar for Sahil89
0
3K
Member Avatar for kRod

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 …

Member Avatar for kRod
0
2K

The End.