Posts
 
Reputation
Joined
Last Seen
Ranked #172
Strength to Increase Rep
+13
Strength to Decrease Rep
-3
99% Quality Score
Upvotes Received
111
Posts with Upvotes
101
Upvoting Members
81
Downvotes Received
1
Posts with Downvotes
1
Downvoting Members
1
52 Commented Posts
11 Endorsements
Ranked #154
Ranked #96
~414.26K People Reached
About Me

I started "computing" as a hobby with Commodore 64 in 1984. Went a few years later to study computer science and math in university. My first PC had a 80286, 1MB RAM and Windows 2.01 in 1990. I programmed with COBOL, C and VB6 in 90's.…

Interests
Downhill skiing, badminton, swimming and sports in general. Sailing, good movies and good books (like…
PC Specs
Processor: Intel Core2 Quad Q8400 @ 2.66GHzRAM: 8 GB Disk: 2x Western Digital RE3 WD5002ABYS-01B1B0…
Favorite Tags

646 Posted Topics

Member Avatar for lolwtf

I don't have a tablet PC to test with, but if things work in the same way as with WinForms, your code should be following [CODE=VB.NET]InkPicture1.Image.Save(IO.Directory.GetCurrentDirectory() & "\test_out.jpg", System.Drawing.Imaging.ImageFormat.Jpeg) [/CODE] The code saves the image from the InkPicture1 control, not from the rectangle. I wasn't sure which one you actually …

Member Avatar for Nathan_20
0
2K
Member Avatar for swathi sajja

Use a loop to add multiple files: With AxVLCPlugin21 .CtlVisible = True .playlist.items.clear() ' Loop until user presses Cancel button and ' add files to the playlist. The code _does not_ check the type of the file! Do Until OpenFileDialog1.ShowDialog() <> Windows.Forms.DialogResult.OK .playlist.add(OpenFileDialog1.FileName) Loop .playlist.play() .Toolbar = True .Show() End …

Member Avatar for André_15
0
3K
Member Avatar for zebnoon1

Passing data between forms has been asked many times. The easiest way is to use a custom property to pass data or a reference to control to hold the data. public partial class Form3 : Form // This is your Form1 { public Form3() { InitializeComponent(); } private void button1_Click(object …

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

I have been a Windows user since version 2.0 and I have never seen "checking for a solution to the problem" to provide any solution. I guess that is a feature, not any actual problem solver ;)

Member Avatar for diafol
1
502
Member Avatar for Reverend Jim

When tossing a coin we can (and will) make following assumptions: 1. the result will allways only be tails or heads 2. the coin is fair i.e. the probability of tails is the same as heads, P(T) <=> P(H) 3. the coin tossing is stateless operation i.e. the coin does …

Member Avatar for xrjf
0
2K
Member Avatar for daveofgv

There are quite a few examples how to open and read an Excel file here in DaniWeb. Like [URL="http://www.daniweb.com/software-development/vbnet/threads/81298"]this[/URL] or [URL="http://www.daniweb.com/software-development/vbnet/threads/29055"]this[/URL]. Just remember to add a reference to Excel (COM component). If you need more examples, there's a search box in the upper right corner of this page. After opening …

Member Avatar for muoixd
0
2K
Member Avatar for murid

You should read data from the socket in "chunks". Here's a snippet from asynchronous socket data transfer [CODE=VB.NET] Private PACKET_SIZE As UInt16 = 4096 . . SyncLock Client.GetStream Reader = New BinaryReader(Client.GetStream) 'next we expect a pass-through byte Client.GetStream.Read(ReadByte, 0, 1) PassThroughByte = ReadByte(0) 'next expect length of data (Int32) …

Member Avatar for Haleem_1
0
2K
Member Avatar for Roger_2

JamesCherrill is correct about O(N). Worst case happens when a binary tree with N nodes is fully biased to left (or right). In your code, null check is always same, that is, it takes a constant time and therefore recursive call to rSize(node.right) takes a constant time. Recursive call rSize(node.left) …

Member Avatar for Mickey_2
0
422
Member Avatar for wael meto

[QUOTE]ChrisPadgham combobox.refreshitems[/QUOTE] AFAIK there isn't such a method in VB.NET. [QUOTE]how can i Refresh ComboBox After Adding New Values via a Seperate Form in vbnet[/QUOTE] Could you post some relevant code how you reference the combobox, call the form, exit form and how you add a new value.

Member Avatar for Alan_10
0
5K
Member Avatar for Joseph_18

Why you use the second combobox??? Simply string[] lineOfContents = File.ReadAllLines(comboBox1.Text); this.richTextBox1.Lines = lineOfContents; or // Now you have a file content in a single string string lineOfContents = File.ReadAllText(comboBox1.Text); // Split string to tokens string[] tokens = lineOfContents.Split(','); // Now tokens is an array of all strings from the …

Member Avatar for tinstaafl
0
309
Member Avatar for Simple man

You have done keyboard hook with SetWindowsHookEx() API call, right? When your keyboard delegate gets keycode for S-key, it replaces it with D-key's keycode (for some reason I do not understand), right? You do know that Ctrl+S sends **two separate keycodes**, one for Ctrl-key and one for S-key, right? Now …

Member Avatar for Teme64
0
257
Member Avatar for alvoryx

Here's how I'd do it [CODE=C#]string myFileData; // File in myFileData = File.ReadAllText(@"D:\test.csv"); // Remove last CR/LF // 1) Check that the file has CR/LF at the end if (myFileData.EndsWith(Environment.NewLine)) { // Yes. 2) Remove CR/LF from the end and write back to file (new file) // File.WriteAllText(@"D:\test_backup.csv", myFileData.TrimEnd(null)); // …

Member Avatar for Ahmad_13
0
9K
Member Avatar for JOSheaIV

First you have to extract the embedded resourse itself to a some temporary file. Then you read and unzip temporary file to the final file. I grabbed these code snippets from a setup program I wrote. It shows how to output an embedded resource and how to deflate (unzip) a …

Member Avatar for JOSheaIV
0
261
Member Avatar for kiran_10

This can be done with a simple Excel formula so you don't need any VBA scripting for this. First you have to figure out how the column number is related to input value (1-5). I used MOD() function to find out when a row "matches" the input value. Cell range …

Member Avatar for Teme64
0
303
Member Avatar for LinaAshaji

Setting panel.BackColor = Color.Transparent does not work like you already noticed. The trick is to use transparency of the form as ddanbe hinted. Here's two overlapping panels on a form. First one is a green square which is drawn behind the "transparent" panel. Second panel is the "transparent" panel. I …

Member Avatar for JOSheaIV
0
315
Member Avatar for Suzie999

> I've tried deleting everything in the release folder, to no avail Have you deleted also `app.config` file from your source code/project folder?

Member Avatar for Teme64
0
179
Member Avatar for zachattack05

ExecuteScalar() method is the correct choice. However returning identity value is not done correctly. Here's a rewritten code. I also replaced questionmarks with parameter names. private bool EventLog(int userNumber, int userID, UserEventTypes eventType, out int recordID) { string ConnectionString; object scalarObject; // Identity value to be returned // Return '0' …

Member Avatar for zachattack05
0
322
Member Avatar for Mike Askew

Here is a one solution TimeSpan timeSpan; string timeStr; int totalHours; int totalMinutes; // 1 day, 6 hrs, 32 mins, 0 secs, 0 msecs timeSpan = new TimeSpan(1, 6, 32, 0, 0); // Get hours and minutes // TotalHours is of type double, cast it to integer (truncate to integer) …

Member Avatar for Teme64
0
2K
Member Avatar for Papa_Don

Before doing any coding you have to consider what will be the environment where your application will be used: - is Office (i.e. Excel) installed - is Office (i.e. Excel) installed with .NET programming support - is reading Excel file(s) all you really need - is there a possibility you …

Member Avatar for Teme64
0
17K
Member Avatar for ddanbe
Member Avatar for LukeJWhitworth

The easiest way to get system information is through Windows Management Instrumentation (WMI). There's a Win32_UserAccount class which provides information about user accounts including SID and Name properties which you asked for. I've been using WMI Code Creator utility to create "code skeletons" and then modified the code to match …

Member Avatar for Teme64
0
944
Member Avatar for Suzie999

Here's another solution. It has some advantages: - user can open context menu over any cell in DGV - you get both column index and row index if you need to remove/add rows too Context menu creation is inside button click handler but probably should be in the code which …

Member Avatar for Teme64
0
395
Member Avatar for Suzie999

Rows and Columns are collections in datagridview control. Both collections have Clear method: dataGridView1.Rows.Clear(); dataGridView1.Columns.Clear(); Now you should have an "empty" datagridview control. HTH

Member Avatar for Suzie999
0
282
Member Avatar for Papa_Don

StartInfo class has Arguments property where you can pass parameters. In your case it is the name of the file you want to open. Add following line after line 5 `.StartInfo.Arguments = "O:\Revenue Management\RM -- Specialty Select Brands\Analytics\Tableau Extracts\Pace\SSB_FR_FUTURE_PACE_LOC.twbx"` Now "O:\Revenue Management\RM -- Specialty Select Brands\Analytics\Tableau Extracts\Pace\SSB_FR_FUTURE_PACE_LOC.twbx" is passed as …

Member Avatar for Papa_Don
0
233
Member Avatar for jakub.peciak

One solution would be to use FileSystemWatcher class which would raise an event when the folder content has changed. After that you would scan the files. BackgroundWorker should be fine for scanning the folder. I didn't test this idea but you could raise ProgressChanged event from your BackgroundWorker thread and …

Member Avatar for Reverend Jim
0
212
Member Avatar for Jun_2

Line 14 should be: `Dim raw_col As Integer = 6 'column # of raw data` Column ordinals are zero-based so indices are as follows - id = 0 - doc_name = 1 - created_by = 2 - date_uploaded = 3 - client_name = 4 - description = 5 - raw_file …

Member Avatar for Teme64
0
453
Member Avatar for zachattack05

First > but I thought with the qualifier of FileSystemWatcher FileSystemWatcher is a type, not a qualifier. When you use foreach loop, your loop variable's type has to match with the collection item's type. So when you loop this.Controls collection you're dealing with a type Control. Here's a sample how …

Member Avatar for zachattack05
0
420
Member Avatar for Darth Vader

ProcessStartInfo class has WindowStyle property: System.Diagnostics.ProcessStartInfo startInfo; startInfo = new System.Diagnostics.ProcessStartInfo(); startInfo.FileName = "opera.exe"; startInfo.Arguments = "http://google.com"; // Set WindowStyle property for the new process startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Maximized; System.Diagnostics.Process.Start(startInfo); HTH

Member Avatar for Teme64
0
521
Member Avatar for crazyhorse09

For some reason it actually does work. Have you tried to change the text's color: [ICODE]Label1.ForeColor = Color.White[/ICODE] ? Here's the code I tested and it works fine[CODE=VB.NET] Label2.Parent = PictureBox1 Label2.BackColor = Color.Transparent Label2.BringToFront() Label2.ForeColor = Color.White Label2.Text = "foo bar" Label2.Location = New Point(20, 20) PictureBox1.Image = Image.FromFile("D:\image.jpg")[/CODE]

Member Avatar for Yunoos Shiddique
0
15K
Member Avatar for Rogel_1

Here's a simple example how to create a custom autocomplete collection: ' Declare a collection public autoComp As AutoCompleteStringCollection ' Create a new collection instance autoComp = new AutoCompleteStringCollection() ' Or clear existing collection autoComp.Clear() ' Add your items to the collection autoComp.Add("first") autoComp.Add("fish") autoComp.Add("fast") ' Set these two properties …

Member Avatar for Teme64
0
198
Member Avatar for jez9

Your code is not messy :) You are using positional parameters (?) so I would change cmd as follows: Dim STOCKSWSRt As Integer = 24 ' Hardcoded value ("numexpected" from the db) Sql = "UPDATE ItemProduct SET stocksretail = stocksretail - ? WHERE CODE = ?" ' Positional params cmd …

Member Avatar for jez9
0
511
Member Avatar for Quast

Here's an answer to "the other thing". Instead of NumericUpDown control you can customize DateTimePicker control dateTimePicker1.Format = DateTimePickerFormat.Custom; dateTimePicker1.CustomFormat = "HH:MM:ss"; dateTimePicker1.ShowUpDown = true; And here's for the first part of the question private void button1_Click(object sender, EventArgs e) { listView1.View = View.Details; // Add two columns first. Here …

Member Avatar for Quast
0
299
Member Avatar for eddy Omatco

First, read [Exception and Error Handling in Visual Basic](https://msdn.microsoft.com/en-us/library/vstudio/s6da8809%28v=vs.100%29.aspx) to understand the basics. After that you can start the actual coding with the help of [Try...Catch...Finally Statement (Visual Basic)](https://msdn.microsoft.com/en-us/library/fk6t46tz%28v=vs.100%29.aspx) HTH

Member Avatar for Mr.M
0
181
Member Avatar for 2advance

Maybe you should post your code. Have you checked [PDF Viewer SDK](http://www.investintech.com/downloads/developer/) they are also offering? HTH

Member Avatar for Teme64
0
215
Member Avatar for TuĂ¡ÂºÂ¥n_2

> this code not work for me! Your code does not work because 1) you collect all div-elements and 2) `elementsByTagName[num].OuterHtml.Contains("URaP8 Kf Pf b-K b-K-Xb")` can match with multiple div-elements Some solutions could be 1) If HTML-element has an id-attribute, use that because it is unique in your web-page: `HtmlElement …

Member Avatar for Teme64
0
302
Member Avatar for aplee

Do you design that database structure too or is it 'fixed'? I assume that you are having only multiple choise questions. The database structure should be similar to this: tbl_ECM_Questionnaire: QuestionID QuestionText CorrectQuestionOptionID 1 "Why..." 2 2 "Where..." 1 3 "When... 2 tbl_ECM_QuestionnaireOptions: QuestionID QuestionOptionID QuestionOptionText AnswerValue 1 1 "Because..." …

Member Avatar for Teme64
0
266
Member Avatar for overwraith

I think almost every computer science book has it. Especially books about algorithms. You could try to find some online course material about algorithms. Check also Wikipedia. HTH

Member Avatar for sepp2k
0
240
Member Avatar for Nandomo

You have to set first datetimepicker's format property to 'Custom' like this: dtmPicker.Format = DateTimePickerFormat.Custom dtmPicker.CustomFormat = "HH" HTH

Member Avatar for Nandomo
0
293
Member Avatar for darragh.mcmahon.5

You have a databound combobox, right? Use cboUsers.SelectedValue.ToString() instead. HTH

Member Avatar for darragh.mcmahon.5
0
2K
Member Avatar for Sheryl99

Can't say if your connection string is right or wrong. However, this is how you create database: [CODE=VB.NET]Dim conStr As String = "Server=DIMENSION9100;Database=;Trusted_Connection = yes" Dim objCon As New SqlConnection(conStr) Dim obj As SqlCommand Dim strSQL as String obj = objConn.CreateCommand() strSQL = "CREATE DATABASE " & DatabaseName ' Execute …

Member Avatar for boxes
0
13K
Member Avatar for kritiohri

I had a code which uses data view to transfer from Access to SQL Server. All you have to modify to transfer from SQL Server to Access, is to change OleDB* variables (objects) to Sql* variables (objects) and vice versa. Read Access table to data view: [CODE=VB.NET]Public Sub ExportTableData(ByVal ConnectionStr …

Member Avatar for elie.karkafy
0
2K
Member Avatar for priyamtheone

If you simply try to detect when the app is closing, use the advice darkagn gave you. Otherwise you have to use Windows API calls. I used [this search engine](http://codesnippet.research.microsoft.com/) and found [this code](http://stackoverflow.com/questions/4615940/how-can-i-customize-the-system-menu-of-a-windows-form). It should be a good starting point. HTH

Member Avatar for priyamtheone
0
399
Member Avatar for Vhyr

Here you are [CODE=VB.NET]PictureBox1.Image = Image.FromFile(<a filename selected from the listbox>)[/CODE] There's a DaniWeb's search in the upper right corner. You can try words "vb.net picturebox file" and you'll find the snippet above. With "vb.net listbox file names" you'll find snippets about listbox handling. HTH

Member Avatar for Reverend Jim
0
200
Member Avatar for khushhappy

No. Download 32-bit driver from [HP's Support Site](http://h20566.www2.hp.com/portal/site/hpsc/template.PAGE/public/psi/swdHome?javax.portlet.begCacheTok=com.vignette.cachetoken&javax.portlet.endCacheTok=com.vignette.cachetoken&javax.portlet.prp_bd9b6997fbc7fc515f4cf4626f5c8d01=wsrp-navigationalState%3DswEnvOID%253D228%257CswLang%253D%257Caction%253DlistDriver&javax.portlet.tpst=bd9b6997fbc7fc515f4cf4626f5c8d01&sp4ts.oid=306507&ac.admitted=1392897471662.876444892.199480143)

Member Avatar for bvestol
0
382
Member Avatar for chrisschristou

Do not use 'window.location'. It navigates to a new page i.e. your popup window. To show a popup, use var strWindowFeatures = "menubar=no,location=yes,resizable=no,scrollbars=no,status=yes"; var windowObjectReference = window.open("http://popup.url/", "Popup Name", strWindowFeatures); See [for more details about window object](https://developer.mozilla.org/en-US/docs/Web/API/window.open). You may also check [window.openDialog](https://developer.mozilla.org/en-US/docs/Web/API/Window.openDialog) method. HTH

Member Avatar for sikander123
0
848
Member Avatar for benjamin_8

Hi Benjamin! You could impress your teacher with this (needs using System.Linq at the start): public bool isPalindrome(string aString) { return aString.Contains(new string(aString.Reverse<char>().ToArray<char>())); } Seriously. A string is an array of characters. Loop that array (i.e. string) by comparing first and last characters, then second character and second last character. …

Member Avatar for Teme64
0
98
Member Avatar for danielagaba

Try to dump out insert statement. I also added connection object to data adapter creation [CODE=VB.NET]Dim conn As New SqlConnection("Data Source=.\SQLEXPRESS; AttachDbFilename=|DataDictionary|\TMSDB.mdf;Integrated Security=True Instance=True") Dim ds As New DataSet conn.Open() ' AFAIK YOU NEED CONNECTION OBJECT IN HERE Dim Adp As New SqlDataAdapter("select * from Housing", conn) Adp.Fill(ds, "Housing") Dim …

Member Avatar for jigar.makhija
0
969
Member Avatar for zahnsoftware

I haven't ever seen that kind of SW. I think you could achieve what you want with FileSystemWatcher control and the methods/properties in the System.IO.FileInfo class. Trap the FileSystemWatcher.Changed event to detect changes in a folder (i.e. file created/saved/deleted etc.). Create objects of the type FileInfo and check their CreationTime/LastAccessTime/LastWriteTime …

Member Avatar for lydia.aram.9
0
181
Member Avatar for gmmorpheus

When you insert a new record you don't have an existing FacultyID value. I suppose you've declared FacultyID as Identity/Autonumber value so you shouldn't try to _insert_ in that field anything. Move line 37 between lines 29 - 30. After that your code accesses FacultyID only when the record exists …

Member Avatar for Kishan Tilak
0
645
Member Avatar for shers

[QUOTE]something that's fast.[/QUOTE] How fast is fast? Ok, how many items in an array you're talking about? Here's a small optimization to code what Ossehaas showed [CODE=VB.NET] Dim Src() As String Const MyStr As String = "abc" If TextBox1.Text.IndexOf(MyStr) < 0 Then ' Not found Else Src = TextBox1.Text.Split(",".ToCharArray) ' …

Member Avatar for markwelbar
0
1K

The End.