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