Jump to content
Xtreme .Net Talk

Volte

*Experts*
  • Posts

    2372
  • Joined

  • Last visited

Everything posted by Volte

  1. I know. I'm suggesting that rather than letting the TransparencyKey property handle the shaping of the form, you use Regions to shape it manually. You shouldn't have any problems them.
  2. The TcpClient is, in my opinion, a rather sub-par socket implementation. I suggest you look into making your own socket client class by making use of the System.Net.Sockets.Socket class and connecting, sending and recieving data yourself. Also, this way you can implement events, so you don't have to poll the TcpClient in its own thread or anything. I believe there is some sort of example and tutorial in the MSDN.
  3. You need to keep a reference to the form, and then you will be able to call any public methods of it. I suggest you read this article on using multiple forms: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vbtchWorkingWithMultipleFormsInVisualBasicNETUpgradingToNET.asp
  4. It would appear the problem is that you are adding a bunch of DataRowView objects to the listbox, and DataRowView's don't have an overloaded ToString() method, so it just returns the name of the type. Since ListBoxes use the ToString() method to tell what string to display for each item, it will always return DataRowView. I would suggest that you try adding the data to the ListBox manually, so you can control exactly what is displayed.
  5. How would you expect us to help you if we don't know what's wrong? You can copy the full text of an error by right clicking it in the Task List and choosing Copy.
  6. You can't, short of recursively searching the whole hard drive for it.
  7. It means it's part of basic C++ that every C++ programmer needs to know, and this is not the place to learn about them. Try looking here here. It took about 45 seconds to find that on Google. I'm sure you'll find tons of other good links by searching Google as well.
  8. This sounds like some sort of homework assignment. We will gladly help you with individual coding issues, but we won't simply explain how to do every last thing, nor will we write your code for you. And Nerseus is correct - if you don't know where to begin, you're starting in a little too deep I think. Create some smaller simpler programs first, and maybe try to create the elements of your project individually before attempting to build them all into one large program.
  9. That will only work for regular Button controls, and not ToolBarButtons. To do it with ToolBarButtons, you will probably need to use the MouseMove event of the ToolBar, and the GetChildAtPoint() method of the Toolbar might work, thought I don't know since ToolbarButtons are just painted on and are not windows in themselves.
  10. Well, where-ever you are "committing" the data (like, a Save button or something), increment a form-wide counter. Something like this: 'Form-wide: Dim count As Integer 'In the Save button or whatever If count < 4 Then 'process the employee count += 1 Else MessageBox.Show("You may only enter 4 employees") End If
  11. What do you mean "after they enter data 4 times"? Could you give an example?
  12. It is likely that this is a video card issue, because this does not happen on my computer. The only solution I can suggest is to use an actual Form Region (you can set the Region property of the form) to shape the form, rather than just using the TransparancyKey property, which I believe uses another method (layered windows, perhaps). Look at the MSDN for the System.Drawing.Region class.
  13. Now that one is VB.NET specific. As a general rule, if you are using a standalone function (i.e. ThisFunction(params) rather than Class.ThisFunction(params)) that is built in to the framework, there is a good chance it is for VB6 compatability. With .NET, almost all functions are built into the classes they modify: stringobject.IndexOf() has replaced InStr(), for example. Nothing stands out on its own except the VB6 compatability library. I really hope Microsoft does away with it in the next .NET, though I really don't see it happening.
  14. You could set the Sorted property to true if you just want simple alphabetic order. If you want a different order, you will need to write a class which derives from IComparer and use it with the Sort method of af an array. An IComparer is just an object which compares two objects and returns whether [Thing A] is less than, equal to, or greater than [Thing B] so it knows where to put it in the array. Note that if you want to use a different IComparer, you will need to use an array to sort it and then add to the listbox.
  15. I'm using it in my C# app right now, so it's not VB specific. I think the idea is that it represents an object rather than a value, so it can be used as such.
  16. I'm thinking they are. I know the framework is available for download, but I can't seem to find any sort of Compact SDK. Maybe the framework comes with compilers?
  17. I think it will be better formatted if you use diff.ToString and it will return a string like you wanted. However, with your, you could get a time like 6:7:2, whereas with diff.ToString it would be 6:07:02.
  18. A possibly more efficient way to do it (plus shorter) is like this:If esEmpTable.Rows(0).Item("middle name") <> Convert.DBNull Then sTemp2 = esEmpTable.Rows(0).ItemI would avoid string comparison wherever possible due to the terrible inefficiency and speed issues.
  19. If you use the proper CLR-compliant method (DateTime structure), you can do it something like this: Dim date1 As DateTime = DateTime.Parse("10:00:00") Dim date2 As DateTime = DateTime.Parse("11:00:00") Dim diff As TimeSpan = date2.Subtract(date1) MessageBox.Show(diff.Hours.ToString())It should show a one hour different between the two. As always, consult the MSDN for more info.
  20. Ah, I was wondering why some of your old posts were guest posts. Same thing happened to Squirm, but he got his original account restored.
  21. Ouch, mutant lost quite a bit. I'm not even sure how much I lost. Couldn't have been much because I hit 1500 not too long ago. Doesn't matter though, they're more accurate now. :p
  22. I would recommend against that - creating files in the Windows directory without telling the user is not a good idea (at least in my opinion). Plus, with a file-system monitor tool like FileMon, it's easy to find out its location. I suggest you just keep a heavily encrypted registry key that is rather difficult to break. Remember, 30-day trial versions are not really effective shareware, since it is generally fairly easy to reset the counter to 0, or even just uninstall and re-install your program. If you really want effective shareware, you need to actually remove functionality from the program.
  23. You should use Int32s not Int64s. Longs in VB are 32-bit, while Longs in .NET are 64-bit, so you need to translate longs to ints when going from VB6 to .NET.
  24. Environment.SystemDirectoryreturns the System32 directory, so you can use System.IO.Directory.GetParent(Environment.SystemDirectory)to retrieve it. However, you should not create files in that directory unless you need to. What file are you creating?
×
×
  • Create New...