Jump to content
Xtreme .Net Talk

Volte

*Experts*
  • Posts

    2372
  • Joined

  • Last visited

Everything posted by Volte

  1. Sounds like a bug with the built in ListView sorting routine, to me. It doesn't seem like its sorting the names as well as the image indexes. You might try using a custom ListView item sorter routine and do it yourself.
  2. It might be over your head, but if you are up to it, there's a VB6 tutorial here (by Garrett Sever) about doing it for VB6. You might be able to get it to work in .NET if you knew what you were doing... It requires heavy API use, and some serious subclassing. Speaking of which, here is a subclassing tutorial by Derek Stone. :) Creating one from scratch might be easier, however.
  3. The memory that belongs to managed objects will be released automatically and collected by the garbage collector when it is no longer needed (i.e. when the program exits). Memory for unmanaged resources (such as GDI32 objects) needs to be manually freed, though.
  4. VB6? This is a .NET forum -- ask VB6 questions at Extreme Visual Basic Forum.
  5. Try something like this:j += 1 Do Until Not filepath(j) Is Nothing And filepath(j).Length > 0 j += 1 If j > filePath.GetUpperBound(0) Then Return Loop P2.Image = Image.FromFile(filepath(j))
  6. Stop doing what? Just put If TabControl.SelectedTab is TabPage2 Then 'I'm not sure of the exact syntax of this 'do whatever it is you want to do End IfIt's not that hard, really. :)
  7. This is no easy task... First, use a RichTextBox, for flexibility. I would suggest splitting the textbox into it's lines (just use the TextBox1.Lines collection), check the current line (RTB.GetCharFromPos, then RTB.GetLineFromCharIndex), and only scan that line on KeyPress. That'll make it faster. You'll also need to detect if you pasted code into textbox (I guess by comparing the number of newline characters before and after the KeyPress event goes through) and if code *was* pasted, you need to scan the whole thing, rather than just the current line. If you have any further, more specific problems, you should post here, but really, there's no right/wrong way to do it. Just optimize it as best you can.
  8. ListBoxes are scrollable by default... just add more words than it can handle and it will scroll. To make it so that clicking one of the items does something, you need to use the SelectedIndexChanged event, and check the value of ListBox1.SelectedIndex (for the index) or ListBox1.Items(ListBox1.SelectedIndex) (for the text) to see what was clicked.
  9. Listboxes are already scrollable... what do you mean linkable? Do you mean so that two listboxes that syncronise their scroll positions? I think you'll need to do some of that old fasioned subclassing; create your own class which inherits the ListBox class, and override its WndProc method -- you'll need to capture the WM_VSCROLL event (I *think*) and send the same message to the other listbox.
  10. ListBox1.TopIndex = ListBox1.Items.Count - 1
  11. That looks like it just finds lines which contain the word "testing" and removes them. The problem with spebola's code is that he is not initializing the object variables. Dim wrdApp As Word._Application Dim wrdDoc As Word.Document Dim oRg As Word.RangeThat creates references, but no actual object. Dim wrdApp As New Word._Application Dim wrdDoc As New Word.Document Dim oRg As New Word.RangeI'm not that familiar with Office Automation, but I think that will probably stop that error. Also, I don't think that CreateObject line is required after you use the New keyword. If problems ensue, remove the New from the wrpApp declaration line and continue to do it using the CreateObject function.
  12. VB5 EXEs are not self-sufficient at all; it's just that the runtimes come with Windows 98. VB6's runtimes are included with Win2K+, and .NET's runtimes are included with XP SP2+.
  13. http://www.rentacoder.com Go there. We don't code for you. Also, even if we were going to, you didn't give us *anything* to start with. :p
  14. This is not only not easily possible, it could easily be abused and used for malicious purposes, so no help will be provided here.
  15. Can we see some code, just to clarify exactly how you are doing this?
  16. I have absolutely no idea what you're trying to do, but I can tell you right now that that code will not do it. 1) You should not ever ever ever use modules, due to the fact that they eliminate the concept of OOP -- always use Shared procedures inside classes. 'in MyClass.vb or whatever Public Shared Sub Main() 2) You need to instantiate the instance of your form: Dim frm1 As [b]New[/b] Form1 3) If you are using Sub Main(), you must manually start the main window message loop, using Application.Run(). After lines, put Application.Run(frm1)and the program will successfully start. 4) That last line, sTest = Form1.TextBox1.Textshould be this: sTest = [b]frm1[/b].TextBox1.Textbecause you need to use the instance of the class, not the class itself. At that point, it should execute... Once the program closes, the last sText line will execute.
  17. Also, you forgot the single quotes around the name value: myCmd.CommandText = "UPDATE email SET name='" & value1 & "' WHERE etc"Also, you'll probably want to make sure that all single quotes in the value1 string are doubled up, so it doesn't cause syntax errors: James O'Neill would need to be added in the SQL statement as James O''Neill, so value1 = value1.Replace("'", "''")
  18. That is only necessary in C#. In VB, the form should be able to create itself. Also, the Sub would need to be Shared for that to work.
  19. ControlName.Dispose() ControlName = Nothing That should do it.
  20. Well, what I said about Javascript and JScript being the same may not be exactly true... it may vary from browser to browser -- Javascript is the Netscape implementation, and JScript is Microsoft's, though I think in IE it doesn't make a difference. It might in other browsers. The two are very similar regardless. I'm also not familiar with the way JScript.NET works, myself. I've just done a bit of reading on it, but it doesn't seem to say when JScript.NET is used. It looks like language="JScript" simply forces the browser to use the version of JScript installed, be it 5.5 or .NET.
  21. You can do something like this: 1) Create a class, called something like AppInit. 2) Inside it, put code like this: Public Shared Sub Main If myCondition Then Dim f As New Form1() Application.Run(f) End If End Sub 3) Set the project's startup object to Sub Main (from Project Properties).
  22. Another (CLR compliant) way to do it is to keep a global Form collection (shared, in a class). Whenever you create a form, add it to this collection. When you're finished, it just takes a simple:Dim f As New Form() For Each f In Globals.AppForms 'Global is the class, AppForms is the shared collection f.Close() Next
  23. You might try using the [api]SetForegroundWindow[/api] API instead, or maybe the [api]SetActiveWindow[/api] API to focus it, instead of the SetFocus API.. Use "IEFrame" for Internet Explorer's class.
  24. Did you check to make sure it actually found that Window? Before you SetFocus(), look at the value of wWindow. Remember, if you're searching on window caption, the text has to be exactly the same. I would recommend that you leave the second parameter (the window caption) as Nothing and specify the first parameter (the window class) as Notepad, since that is the Notepad window's class.
×
×
  • Create New...