- Strength to Increase Rep
- +13
- Strength to Decrease Rep
- -3
- Upvotes Received
- 111
- Posts with Upvotes
- 101
- Upvoting Members
- 81
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
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…
646 Posted Topics
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 ;) ![]() | |
Re: 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 … | |
Re: 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 … | |
Re: 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) … | |
Re: 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) … | |
Re: [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. | |
Re: 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 … | |
Re: 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 … | |
Re: 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)); // … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: > 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? | |
Re: 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' … | |
Re: 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) … | |
Re: 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 … | |
Re: I think that `Application.ExecutablePath` should also work. | |
Re: 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 … | |
Re: 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 … | |
Re: 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 | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 | |
Re: 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] | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 | |
Re: Maybe you should post your code. Have you checked [PDF Viewer SDK](http://www.investintech.com/downloads/developer/) they are also offering? HTH | |
Re: > 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 … | |
Re: 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..." … | |
Re: 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 | |
Re: You have to set first datetimepicker's format property to 'Custom' like this: dtmPicker.Format = DateTimePickerFormat.Custom dtmPicker.CustomFormat = "HH" HTH | |
Re: You have a databound combobox, right? Use cboUsers.SelectedValue.ToString() instead. HTH | |
Re: 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 … | |
Re: 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 … | |
Re: 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 | |
Re: 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 | |
Re: 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) | |
Re: 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 | |
Re: 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. … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: [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) ' … |
The End.