646 Posted Topics
Re: Multi column listbox doesn't actually show items in multiple columns. It "wraps" items to the next column when you add them and the number of the items reaches the listbox's height. If you want to show items in two columns, you'll have to use some grid control or listview control. … | |
Re: You have to get the qualified type name first i.e. get the right namespace. Then you can create an instance of that name and convert it to a form (since you know it's a form)[CODE=VB.NET] Dim objForm As Form Dim sValue As String Dim FullTypeName As String Dim FormInstanceType As … | |
Re: Why do you use For Next loop??? Here's how I would do it in .NET way: [CODE]Dim Gen As System.Random Gen = New System.Random(My.Computer.Clock.TickCount) Txtrandom.Text = Gen.Next(1, 101).ToString[/CODE] A few points: - I would use computer clock's TickCount as a seed number - Next(1, 101) method generates integers from 1 … | |
Re: You can download straight from the Microsoft (you should find VB.NET 2005 EE also from there): [URL="http://www.microsoft.com/express/vb/"]Visual Basic 2008 Express Edition[/URL] and that's the only [B]legally distributed[/B] free version of VB.NET. HTH | |
Re: Here's the simplest way. This calculates the sum of the fourth column [CODE=VB.NET]Dim TotalSum As Double = 0 Dim TempNode As ListViewItem For Each TempNode In ListView1.Items TotalSum += CDbl(TempNode.SubItems.Item(3).Text) Next MsgBox(TotalSum) ' Debug [/CODE]and it assumes that each item is a valid number. A bit safer solutions uses TryParse … | |
Re: Does it work if you add a semicolon after User ID: `"Provider=MSDAORA;Data Source=xe;Persist SecurityInfo=True;Password=me;User ID=cj;"` | |
Re: Use Path class: `Dim dbpath As String = Path.GetDirectoryName(FileName)` HTH | |
Re: Here's a thread-safe way to assign text to the (UI-thread) control: Delegate Sub SetTextCallback(newString As String) Private Sub SetText(ByVal newString As String) ' Calling from another thread? -> Use delegate If Me.TextBox1.InvokeRequired Then Dim d As New SetTextCallback(AddressOf SetText) ' Execute delegate in the UI thread, pass args as an … | |
Re: In the line 17 you set a connection object to a command object: `myCommand.Connection = conn` In the line 18 you create a new command object which destroys previous command instance: `myCommand = New MySqlCommand(comm)` and this new command object doesn't have an open connection. Solution: swap lines 17 and … | |
Re: First, use Try...Catch...End Try to catch the error. It helps to solve the problem. And secondly, everything you do with the web is always more or less error prone. Basic problem in your code is understanding how communication works between server and the client. In the code above you **request** … | |
Re: [QUOTE]Intellisense says that Interface "outlook.item" cannot be indexed because it has not default property.[/QUOTE]I believe it said "[B]outlook.items[/B]". Yes, you have to use Item property of Outlook.Items collection. I partly rewrote the OP's code. Simply commented out some lines, added few properties for the appointment and fixed the error mentioned … | |
Re: Add a reference to System.IO namespace. Before saving your Excel file (line 155) check if the file already exists and if it does, just delete the previous file: if (File.Exists("c:\\test\\test.xls")) File.Delete("c:\\test\\test.xls"); | |
Re: I don't see any point for using threading in this code. I wrote a simple example how to get the content of the final page i.e. not HTML code. This code uses a button to start loading, a label to show what's happening and a multiline textbox where I dump … | |
Re: Hi Coolvibes! Do not post the same question to multiple forums. This is a VB.NET forum and you're using VB6 so [Visual Basic 4 / 5 / 6](http://www.daniweb.com/software-development/visual-basic-4-5-6/4) forum, where you ask the same question is the right place for your question. | |
Re: If you use a short delay, user won't notice any freezing. [CODE=VB.NET]Threading.Thread.CurrentThread.Sleep(1000)[/CODE] and the parameter is in milliseconds. Above code causes one second delay. | |
Re: I'm not sure what you mean by 'window' but you maximize forms by setting their WindowState property: [CODE=VB.NET]Private Sub Form1_DoubleClick(sender As Object, e As System.EventArgs) Handles Me.DoubleClick Me.WindowState = FormWindowState.Maximized End Sub[/CODE]Now when you double-click your form called Form1, it changes it's WindowState to Maximized. HTH | |
Re: There's never a 100% secure solution. First, do not store password in plain text. Use some hash function to calculate hashed value of the password and store this hashed value. Some methods are MD5, SHA1 or simple CRC32 etc. You'll find sample code with Google. So when the user gives … | |
Re: There's no reason to convert a datetime value to a string. Use Hour and Minute properties instead [CODE=VB.NET]Dim day As String = Format(Today, "dddd") Dim time As Date Dim CurrHour As Integer Dim CurrMinute As Integer time = DateTime.Now CurrHour = time.Hour ' Get current hour value CurrMinute = time.Minute … | |
Re: 100 ms is a quite short time to application load. Instead of [ICODE]System.Threading.Thread.Sleep(100)[/ICODE] you may try [ICODE]procSungard.WaitForInputIdle(10000)[/ICODE]. You'll have a higher chances that the app is actually loaded, UI running and thus app is processing message queue. Setting focus requires API calls. Get handle to application window: [ICODE]Public Declare Function … | |
Re: Here's how you create your panel at run time [CODE=VB.NET]Dim newPanel As Panel newPanel = New Panel() ' Set "child" panel's properties '... ' Set a unique name for each panel newPanel.Name = "ChildPanel1" ' Set Click event handler AddHandler newPanel.Click, AddressOf childPanelClick ' Add panel to main panel's controls … | |
Re: [QUOTE]i'm getting an error..[/QUOTE] Next time post the error message. You set the formats like this [CODE=VB.NET] DateTimePicker1.Format = DateTimePickerFormat.Custom DateTimePicker1.CustomFormat = "dd-MMM-yyyy" DateTimePicker2.Format = DateTimePickerFormat.Custom DateTimePicker2.CustomFormat = "yyyy"[/CODE] then you trap DateTimePicker2's ValueChanged event, right? [CODE=VB.NET]Private Sub DateTimePicker2_ValueChanged(sender As Object, e As System.EventArgs) Handles DateTimePicker2.ValueChanged ' Dim newYear As … | |
Re: I've posted this link a few times before here in DaniWeb: [URL="http://www.developerfusion.com/tools/convert/csharp-to-vb/"]Convert C# to VB.NET[/URL] See if it helps you. | |
Re: [QUOTE]Window.document it is the property in vb 6.0[/QUOTE] No it isn't. It's the property of a HTML page loaded in the webbrowser control. In VB.NET WebBrowser.Document [QUOTE]Gets the Document object that represents the hosted HTML page[/QUOTE] and that's the same as what Window.document did in VB6. WebBrowser.Document has GetElementById() method … | |
Re: If you want to prevent user to doing something you usually can achieve that with (local) group policy objects. You edit LGPOs with Group Policy Editor, but GPOs in fact modify your registry just like you thought. You can [URL="http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=25250"]download[/URL] available Group Policy settings and check if you find those … | |
Re: You're comparing file's name to a date. The comparison should be [CODE=VB.NET]If fri.LastAccessTime > sDay Then[/CODE] You should also move [ICODE]FSO = CreateObject("scripting.filesystemobject")[/ICODE] before [ICODE]For Each fri In fiArr[/ICODE] because now your loop creates a new object in each iteration. After the loop (line [ICODE]Next fri[/ICODE]) dispose the filesystem object … | |
Re: If you just want to download videos, there are some add-ons for Firefox (maybe for IE too) that can download streamed videos. If you really want to do that with VB.NET, you can't use any simple DownloadFile method because the videos are streamed. Streamed videos are, however, saved to browser's … | |
Re: Skatamatic, 64-bit version has development tools and 32-bit version doesn't. Pseudorandom21, no, it doesn't even install on VMware VM. The problem is with Win8 HAL. | |
Re: [QUOTE]Could it be implemented on the vb.net or i should do it on C#?[/QUOTE] Doesn't make any difference. Both will do the job. [QUOTE]and analyse the file signature[/QUOTE] What do you mean by file signature? Something (a hash value) you've pre-calculated from the files in a file system and associated … | |
Re: [QUOTE]Is this possible i the first place?[/QUOTE] Yes it is. [QUOTE]If yes, then how?[/QUOTE] Here's a subroutine from my crapbox. The extra features you'll get are: restrict files with file creation date and/or with file size. I was too lazy to take those off, but you can do it by … | |
Re: [QUOTE]is this possible?[/QUOTE] Yes it is. First, here's a very straightforward solution for the search. You need a list box, text box and a button. Type a search-term in the text box and press the button. [CODE=VB.NET]Private Sub SearchListBox(ByVal searchTerm As String) ' Fill test data ListBox1.Items.Clear() ListBox1.Items.Add("Apple") ListBox1.Items.Add("Banana") ListBox1.Items.Add("Guava") … | |
Re: I'm not familiar with FoxPro but DESC is related to ORDER BY. With "standard" syntax the query should be [CODE]SELECT product.code, ullage.counttotal FROM product LEFT JOIN ullage ON product.code = ullage.code ORDER BY product.code DESC[/CODE] HTH | |
Re: There's not such a method in StreamReader class that reads a specific line, see [URL="http://msdn.microsoft.com/en-us/library/system.io.streamreader.readline.aspx"]StreamReader.ReadLine Method[/URL]. Instead, if you need a specific line, read the lines to a string array and get the specific line from the array. Another solution would be to use counter variable for the lines: [CODE=VB.NET]Dim … | |
Re: [QUOTE]The .ico file is 344Kb larger[/QUOTE] That's not a Windows Icon File. Not quite sure but X Windows system has icons of that size. If you want a Windows ico file with a few Kb, try to convert file. If you don't have a suitable application, try open source [URL="http://www.gimp.org/"]GIMP[/URL]. … | |
Re: To make it really unique you would have to come up with a new compression algorithm. See [URL="http://en.wikipedia.org/wiki/Data_compression"]Data compression[/URL] what exists and come up with a new idea. After that you have to implement the algorithm and compare it's "efficiency" with other methods/applications, like 7z, WinZip, WinRAR etc. I don't … | |
Re: If you're using a namespace [ICODE]using Microsoft.Office.Interop.Excel;[/ICODE] you can't refer to types as [ICODE]Excel.Application[/ICODE] or [ICODE]Excel.Workbook[/ICODE]. You use just Application and Workbook. Application is a reserved word in .NET. Use _Application or Microsoft.Office.Interop.Excel.Application instead. HTH | |
Re: Hi rohitgeek! Please start a new thread for your question. You're not answering or solving the original question about pop-up windows. You'll get answers to your question when everybody sees what [U]you[/U] are asking :) And gomathinayagam could do the same. | |
Re: Here's the documentation of [URL="http://msdn.microsoft.com/en-us/library/system.windows.forms.treeview.selectednode.aspx"]TreeView.SelectedNode[/URL]. Your ReadFile function works just fine, so the problem has to be in the passed argument (filePath). You could add following lines to the beginning of ReadFile: [CODE=C#]if (filePath == null) MessageBox.Show("FilePth has null value"); if (!File.Exists(filePath)) MessageBox.Show("File: '" + filePath + "' not found");[/CODE] … | |
Re: Don't try to save leading zeroes. That's just a way to display, not to store, numbers 1,2,3 etc. and you already know how to use PadLeft(5, "0") function. HTH | |
Re: Your code [U]may[/U] exit the loop, but [ICODE]StrOut = txtAnswer.Text[/ICODE] should probably be [ICODE]txtAnswer.Text = StrOut[/ICODE]. HTH | |
Re: You use plain [ICODE]oSelection.EndKey()[/ICODE] which moves to the end of the line. EndKey's first parameter is the units where to move, in your case to the end of the document: [CODE=VB.NET]Dim oWord As Word.Application Dim oDoc As Word.Document Dim oDoc2 As Word.Document Dim oDoc3 As Word.Document Dim oSelection As Word.Selection … | |
Re: Move line 26. [ICODE]List<string> temp = new List<string>();[/ICODE] to line 29. and drop [ICODE]temp.Clear();[/ICODE] HTH | |
Re: You could take timespan object by subtracting start date from end date. Now you would have "a single datetime value". But if you need to get back either start date or the end date from the timespan, you can't do it. In that case the only solution is to add … | |
Re: With a PNG image, open image file in your graphics program and set palette transparency i.e. the "background" color of X and O to transparent in the images palette. You should be able to do this with any graphics application. If you have also X and O images with non-transparent … | |
Re: Here's a link to code to extract icon: [URL="http://www.codeguru.com/csharp/csharp/cs_misc/icons/article.php/c4261"]Getting Associated Icons Using C#[/URL]. I still use that code. To drag and drop files: [URL="http://codehill.com/2009/06/drag-and-drop-files-to-a-c-application/"]Drag And Drop Files to a C# Application[/URL]. I found that with some googling and it seemed a very simple and easy to understand example. Since the … | |
Re: You did get this [ICODE]new Form2.show();[/ICODE] through the compiler??? Anyway, this is how it should be done [CODE=C#]for (int i = 0; i < numOfCopies; i++) { Form2 newForm; newForm = new Form2(); newForm.Show(); }[/CODE] | |
Re: [QUOTE]Do you have an idea how is the best way to overcome this problem?[/QUOTE] Not at this moment :) I have a little doubt about Active Directory's part in your problem. Have you tried changing log files ACL? | |
Re: [QUOTE]..i try this but cant work Call lnkFromPR_LinkClicked(sender, e) [/QUOTE] I'm sure that e is of type System.EventArgs but now it should be of type LinkLabelLinkClickedEventArgs Here's one way to do it [CODE=VB.NET]' Get selected link Dim thisLink As LinkLabel.Link ' Just take the first link thisLink = LinkLabel1.Links.Item(0) ' … | |
Re: [QUOTE]I know there must be a quicker and more efficient way of fixing this problem[/QUOTE] I'm afraid there isn't. In fact, if you suspect user to change system clock, you'll always have to check NTP. .NET doesn't have any built-in support for NTP but I found [URL="http://www.codeproject.com/KB/datetime/SNTPClient.aspx"]An SNTP Client for … | |
Re: Replace line 59: [CODE=C#]cmd = null; cmd = new OleDbCommand(); cmd.Connection = MyConnection.con; cmd.CommandText = "INSERT INTO supplier...[/CODE] HTH |
The End.