4,901 Posted Topics

Member Avatar for themaj

If you set the forms KeyPreview property to True you can use the following code Public Class Form1 Private Sub Form1_KeyPress(sender As Object, e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress If Me.ActiveControl.GetType = GetType(TextBox) Then Me.Text = e.KeyChar Select Case e.KeyChar Case "0" To "9" Case Chr(Keys.Back) Case Else e.Handled = True …

Member Avatar for themaj
0
156
Member Avatar for Gus_19

How are you opening/modifying/saving the data? Please post your code so we can tell you where you are going astray. Are the duplicate rows being inserted or are they being appended to the worksheet?

Member Avatar for Gus_19
0
200
Member Avatar for nmges

if you Import System.Text.RegularExpressions then you can use the following test If RegEx.IsMatch(textbox.Text,"\d{4}\.\d{2}") Then 'the text matches the pattern ####.## Else MsgBox("the text must be in the form ####.##") End If 'or if you don't want to do the import you can fully qualify as If System.Text.RegularExpressions.RegEx.IsMatch(textbox.Text,"\d{4}\.\d{2}") Then 'the text …

Member Avatar for Reverend Jim
0
169
Member Avatar for Mike Bishop

Dim tokens() As String = "17:55:88".Split(":") This will give you an array with indices from 0 to 2 where tokens(0) = "17" tokens(1) = "55" tokens(2) = "88"

Member Avatar for Reverend Jim
0
128
Member Avatar for Reverend Jim

I know you are busy fixing bugs and tweaking (and I very much appreciate the effort) but I have a suggestion to slightly tweak the email notification. The old system would not send an email to tell me that there was a new posting on a watched thread if the …

Member Avatar for Dani
0
194
Member Avatar for arabgogs

It sounds like you are willing to get technical. A really good book is Object Oriented Analysis and Design by Grady Booch. Daniel R. Clark also has a book, Beginning Object-Oriented Programming with VB 2005 From Novice to Professional.

Member Avatar for Reverend Jim
0
144
Member Avatar for choosechrist

The items in a treeview already have a + or - symbol to the left which when clicked will show or hide child nodes.

Member Avatar for Reverend Jim
0
126
Member Avatar for oskole

> Dim regBaseKey new As RegistryKey = Registry.LocalMachine Instead of Dim regBaseKey new As RegistryKey = Registry.LocalMachine try Dim regBaseKey As New RegistryKey = Registry.LocalMachine

Member Avatar for thines01
0
90
Member Avatar for s98samman

You are trying to assign a string value to an integer variable. In order to do the assignment you should first (as stated by jwdunne) determine that the conversion is possible. If the conversion is possible you can use Convert to do the conversion as in Dim b As Integer …

Member Avatar for JGorard159
0
561
Member Avatar for bigzos

In that case you are misusing the term "exact". Unless you mean you want a result of 1 when the difference is exactly one year. If you are not interested in fractions of a year then do as was suggested and find the difference in days then take the integer …

Member Avatar for poojavb
0
135
Member Avatar for kiyu2keith

You could do For Each s As String In {"0", "12", "345", "6789"} Debug.WriteLine(s) Next

Member Avatar for kiyu2keith
0
567
Member Avatar for abc_123abc

Can you please clarify? What are the contents of the text file and how do you want it parsed to go into the datagrid? What is the layout of the datagrid? An example might be "I have a text file containing lines of comma separated values. I want to display …

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

REF: http://www.daniweb.com/software-development/vbnet/threads/422252/retrieve-and-save-to-another-excel-workbook I submitted a post recently. The post did not appear, even when I refreshed, then closed and reloaded the page. This has happened before so, fortunately, I had copied my post text to the clipboard. I submitted the post again. This time is was accepted and displayed. When …

Member Avatar for Reverend Jim
0
127
Member Avatar for poojavb

What you are describing is more of an *irregular* expression. Your character classes need not be in any particular order. I believe you are far better off handling the validation in code. This will be clearer and more maintainable. Also, your requirements appear to be in conflict > atleast one …

Member Avatar for poojavb
0
249
Member Avatar for mancode1007

In English, what is your query supposed to do and what happens when you run it?

Member Avatar for wen_cai
0
166
Member Avatar for bigzos

Can you post an excel file with some sample data which causes the problem you are describing?

Member Avatar for bigzos
0
622
Member Avatar for maharjun

The only difference I have seen in various defraggers is the minimum free space required for them to work. At the time (pre Windows 7) PerfecDisk worked with as little as 5% free space. Since I installed Windows 7 I have not bothered to install a third party defragger.

Member Avatar for breactiv
0
167
Member Avatar for prancode

First step is to search this forum. That's what the big SEARCH box at the top is for. If you do that you will find [this code](http://www.daniweb.com/software-development/vbnet/code/366392/encryption-and-decryption-functions-in-vb.net)

Member Avatar for Reverend Jim
0
245
Member Avatar for renzlo

If you are using a recent version of SQL server (2005 or newer) you can use the new ranking functions. Your specific query to generate the above results would be SELECT TOP 5 RANK() OVER (ORDER BY IAVERAGE) AS Rank, USERNAME,ICOUNT,IAVERAGE,DATE_LOGGED FROM MyTable WHERE IAVERAGE > 0 AND DATE_LOGGED='05-07-2012' RANK() …

Member Avatar for renzlo
0
379
Member Avatar for PDB1982

Silly question - why not just have one field on the form for "name"? What possible reason is there to have it more than once if you are just going to replicate it?

Member Avatar for ChrisPadgham
0
290
Member Avatar for sidyusuf

Do you need help with the database update as well? The answer would depend on whether you need help with the query itself or the connectivity. And the answer may depend on what type of database you are using and how you are storing the date/time value.

Member Avatar for poojavb
0
1K
Member Avatar for NiTeHaWk4787

You can define one handler to be used for all of the buttons and determine which button was clicked by checking the Text property in the event handler. Can you be more specific as to what you mean by "five separate functions for each button's click event"?

Member Avatar for Gé48
0
120
Member Avatar for Reverend Jim

Yesterday I clicked "Mark Forum Read" in the VB.Net forum. Today I am seeing articles for which the most recent postings are 2-3 days old being flagged as NEW.

Member Avatar for Dani
1
64
Member Avatar for jprs.22

I rather doubt it. In four code mudules you have around 6 comments, mostly consisting of 2-3 words and those are in Spanish. You haven't said where in the code you are having the problem (apparently it is up to us to scan through undocumented/uncommented code and figure it out)., …

Member Avatar for Reverend Jim
0
121
Member Avatar for waleed.makarem

Instead of asking how to implement a particular solution, you may want to ask youself if the solution you have picked is appropriate for the problem you are trying to solve. Perhaps if you tell us the underlying goal we may be able to offer a better approach.

Member Avatar for Reverend Jim
0
1K
Member Avatar for Iamateur

When you insert a record, no other records are affected. A typical insert looks like insert into [tablename] (list of field names) values(list of field values) In this case, only one record is ever inserted. To delete a record the format is delete from [tablename] where [sequence of fldname=value clauses] …

Member Avatar for Reverend Jim
0
205
Member Avatar for Reverend Jim

I know it's been busy with the rewrite and tweaking but I haven't seen a newsletter issued in ages.

Member Avatar for Reverend Jim
0
57
Member Avatar for seek

You select records from a database using the SELECT statement. You can select all fields or a series of named fields. For example select * from Employees select FirstName, LastName, Salary from Employees The first statement selects all fields, the second selects only the named fields. All records in the …

Member Avatar for Reverend Jim
0
165
Member Avatar for Iamateur

What are the items in each and how are the items in combo2 supposed to be restricted after combo1 is selected?

Member Avatar for Reverend Jim
0
148
Member Avatar for Reverend Jim

I'm confused (not an uncommon state lately, I'm afraid). A short time ago I posted some VB code using the CODE button. In response I was told by pyTony that I should be using fences. Today when I went to post some code, the posing area had a large banner …

Member Avatar for Dani
0
194
Member Avatar for vijaybrar

How about [code] Private Function Rotate(ByVal s As String, ByVal places As Integer) places = places Mod s.Length If places < 0 Then places += s.Length Return Mid(s, places + 1) & Mid(s, 1, places) End Function [/code] Try a few values (positive and negative) for "places". Note the "mod" …

Member Avatar for Reverend Jim
0
157
Member Avatar for bettybarnes

Keep in mind that just because you can solve a problem with recursion it doesn't mean that you should. Traversing a binary tree is a good example of where recursion is desirable, and actually produces clearer code than alternatives. Calculating factorials is a usual example to teach recursion. But that's …

Member Avatar for Reverend Jim
0
86
Member Avatar for bigzos

To make it more general you could replace >= 2009 with DATEPART("YEAR",GETDATE())-3

Member Avatar for bigzos
0
99
Member Avatar for Begginnerdev

It sucks (abandoning WinForms). I'm awfully tired of Microsoft pushing their "latest and greatest", then abandoning it for the next "latest and greatest". Because I develop apps only for my personal use I will likely just continue usinig WinForms under Visual Studio 2010 as long as it continues to run. …

Member Avatar for Begginnerdev
0
176
Member Avatar for tariqi2011

Can you please clarify? An inner join is used to create a virtual (temporary) table that is the result of combining two other tables based on a (single) common column. Perhaps if you posted the schema of the two tables, and the schema of the virtual table you want as …

Member Avatar for tariqi2011
0
206
Member Avatar for jbennet

Can we get back the ability to sort the threads based on the starting date? The first thing I always did when going into a forum was set the display to show newer threads first. Perhaps this could be added as a default in the control panel.

Member Avatar for Airshow
0
2K
Member Avatar for Sahil89

There is no event that I am aware of that triggers when you open a file from within your program. You don't need an event triggered because you are already executing code, starting with the method you called to open the file. As for "open with", you can set your …

Member Avatar for Sahil89
0
95
Member Avatar for Gé48

Post your code. When I used the following code it worked fine. ~~~ vb Private Sub ListBox1_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ListBox1.SelectedIndexChanged TextBox1.Text = ListBox1.SelectedIndex End Sub ~~~

Member Avatar for Reverend Jim
0
219
Member Avatar for jrlittle86

You can find a step-by-step tutorial [here](http://msdn.microsoft.com/en-us/library/k3bb4tfd.aspx)

Member Avatar for Reverend Jim
0
320
Member Avatar for Begginnerdev

That's somewhat different from the old style of code tags and definitely not intuitive. Is there any place that explains how the new system works? For example, as I am typing, the code tag in the first sentence is blue and underlined and everything following that is red. I don't …

Member Avatar for Dani
0
295
Member Avatar for Reverend Jim

Here is a question I do not recall being addressed. In the last week I have had to completely rebuild my system. Following a lengthy install and configuration I had to look for the locatiuon of a settings file for an application (to make a backup). Being a dinosaur, I …

Member Avatar for Reverend Jim
1
289
Member Avatar for Clipper99

Once you get everything re-installed (OS, Apps, anti-virus, etc.), configured and all updates applied you might want to consider installing a disk imaging program (Macrium Reflect is highly rated and free for personal use). Take a disk image of your system partition and save it somewhere. If you get reinfected …

Member Avatar for rubberman
0
291
Member Avatar for paoi00

Post (or attach) a few records from the database and I'll have a look at it locally. If you can zip and attachthe entire database then I'll also have the schema.

Member Avatar for poojavb
0
246
Member Avatar for fafa70

Using a DLL does not decrease the speed of a process. Compiled code is compiled code whether it resides in a main module or a library. By putting common code into a DLL, however, you make it available to multiple projects without having to recompile it, and (as far as …

Member Avatar for thines01
0
260
Member Avatar for Reverend Jim

I have a form with a TableLayoutPanel with the following properties changed from default: Dock = Fill AutoSize = True AutoSizeMode = GrowAndShrink ColumnCount = 1 Margin.All = 0 one row set to AutoSize This is a stripped-to-the-basics version of part of my app. I want to generate a vertical, …

Member Avatar for Reverend Jim
0
2K
Member Avatar for Reverend Jim

By a strange (and fortunate) coincidence, while DanaWeb was down for the upgrade I had to completely rebuiild my system due to a hard drive failure (fortunately I had warning so I had complete backups). However, I've noticed some odd behaviour since then that I don't know is the result …

Member Avatar for Sahil89
0
181
Member Avatar for sing1006

Each object (control) that you create is given a unique name by default, such as TextBox1, TextBox2, etc. which you are free to change as long as it remains unique. You can see that name in the properties view. Just refer to the object by that name.

Member Avatar for Reverend Jim
0
101
Member Avatar for paoi00

If you want to compare and ignore case you can use String.Compare(stringa,stringb,True) The third parameter is True to ignore case, False otherwise. It returns -1 if stringa < stringb 0 if stringa = stringb +1 if stringa > stringb

Member Avatar for paoi00
0
497
Member Avatar for tashee2007

In the AfterSelect event handler of the treeview you can do Dim text() As String = TreeView1.SelectedNode.Text.Split("-") Then your first textbox is Trim(text(0)) and the second textbox is Trim(text(1))

Member Avatar for Reverend Jim
0
928
Member Avatar for Gus_19

The End.