Jump to content
Xtreme .Net Talk

snarfblam

Leaders
  • Posts

    2156
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by snarfblam

  1. Are you trying to inherit the Graphics class? This wouldn't be possible since it is capped, i.e. noninheritable, which means that you can not extend its functionality in an object-oriented manner. You could create your own static DrawLine method that could accept a Graphics object and parameters neccessary for a line, split the line into segments appropriately, and draw them with the appropriate colors using the Graphics object that was passed. (When it all gets compiled down to native code it would essentially be the same thing; it just wouldn't look as pretty in the code editor.)
  2. You will probably notice that you get the same exact behavior with any other MDI application. This is just how MDI applications work. The idea is to incorperate the menus of the parent and child seamlessly. I don't know if there is a non-.Net way to place the menu inside the child, but even if there is, I don't recommend it. Check out the MenuItem.MergeOrder and MenuItem.MergeType properties in MSDN to see how you can get your menus to merge appropriately.
  3. For most programs on most hardware it is off by default. When dealing with vector graphics, it smooths the "jaggies", the jagged effect that is a result of the fact that computer graphics are nothing but images composed of squares (rather large ones, too, compared to the resolution of printed media). A good example of jaggies can be seen if you closely inspect a truetype font on a system without cleartype. It looks all squarey. A good example of antialiasing would be cleartype itself. I used to always leave it on because it made my Unreal and Doom look freakin' awesome. There is a performance hit though, and if your hardware is not up to the task, it will kill your framerate. How you enable/disable it depends on your hardware. It might come with an easy settings utility. Mine is buried deep within my display properties, but it also came with a system tray utility that makes it a piece of cake.
  4. It does come with vs.net professional. You can also buy better ones. Supposedly, the best ones will usually crash decompilers/dissassemblers or at least simply not disassemble. I've never tried one though; I'm not developing anything groundbreaking or particularly secure.
  5. Do the breakpoint markers in the margin have a question mark in them? If so, this would indicate that due to come configuration, the program will not stop at that breakpoint.
  6. VB .Net, by default, saves all your open documents and builds when you click the "run" button. This behavior can be modified by going to Tools>Options>Environment\Projects and Solutions\.
  7. You can save yourself some typing with the TypeOf...Is operator. Public Sub SomeMethod() For Each Obj As Control In frmTheForm.Controls If TypeOf Obj Is TextBox Then Dim txt As TextBox = DirectCast(Obj, TextBox) 'Do some stuff with your txt object End If Next End Sub
  8. Depending on what you are doing with the strings, you might find this useful: Default Marshalling for Strings
  9. You will probably have to read bytes and process their individual bits yourself. You might want to consider using something like the System.Collections.Specialized.BitVector32 class, which treats four bytes like an array of 32 bits. If you are lucky, maybe someone can provide you with a class that can handle binary data as an array of bits.
  10. Your post was big and it hurt my head. I hope these might help: To convert a string to bytes with one byte per character (like a C++ char), use the System.Text.ASCIIEncoding class. There are tutorials that can be found with google that show how to read/write structs to a file using the FileStream class. This example is in VB but it should be easy to translate to C#.
  11. I doubt that you can change the device. I'm just guessing here, but I would think that once you create the texture, it is tied to a physical device (represented by the device class) which cannot be changed, and which is why the device must be passed to the constructor.
  12. Passing an object, a variable of reference type, ByRef allows you to modify the reference, passing it ByVal doesn't (just as passing an integer ByRef allows you to modify the integer, whereas passing ByVal doesn't). Public Sub TryByRef(ByRef X As Form) X = New Form End Sub Public Sub TryByVal(ByVal X As Form) X = New Form End Sub Public Sub ByRef_vs_ByVal() Dim Test As Form = Nothing TryByVal(Test) 'Test is still Nothing MessageBox.Show((Test Is Nothing).ToString) TryByRef(Test) 'Test is now pointing to a form MessageBox.Show((Test Is Nothing).ToString) End Sub
  13. Did you read what I linked to?
  14. Managed DirectX is designed to be run by managed applications, i.e. applications that run on the .Net Framework: VB.Net, C#, J#, and Managed C++ applications. The native DirectX is intended to be run by other applications, which are compiled to native code, like C++ can be. You can not compile to native code with a .Net language. I could be wrong, but I don't think that you can interop with native DirectX through a managed language. You wouldn't really want to anyways. Either stick with VB/C# and managed DirectX, or regular DirectX and C++.
  15. I think that the idea is for something quicker and easier. As far as I know, there is no way to modify what is displayed in these tooltips. I think that these tooltips should display the return of the .ToString function. The default implementation of the .ToString function returns exactly what you would see in these tooltips, but this would provide you with the ability to customize the tooltips and provide more meaningful, convinient information. Unfortunately, this is not the case.
  16. Google comes to the rescue! A Google search for vb.net 2005 "sub main" yields this. Microsoft has introduced the Application Framework which encapsulates many tasks associated with creating an application. One of the function provided by the Application Framework is to start your application up for you on its own terms, which does not include a Sub Main. Visit the link to learn how to work around this issue.
  17. have you tried putting a Public Shared Sub Main in the form's code?
  18. Would love to make it if I knew where to start.
  19. Well, making a post on a topic like this might get a lot of biased responses. Keep that in mind. That being said, there are advantages to VB6 and VB.Net. And C#. And Java. And C++. You name it, there is an appropriate application of it. It depends on your needs, both current and future. Plan ahead. VB.Net will be the easiest transition. For me it the transition was very easy. It seemed like everything was right where it should have been in the first place, and everything that should never have been there was gone, and everything that should have been there and wasn't could now be found right where you expected it. (Realistically, I spend quite some time in the object browser, but my point is that there were very things I couldn't figure out on my own in a small amount of time.) That is just me, and your experience could very possibly be different. My opinion of everything that VB should be might differ from yours. There are lots of arguments about VB.Net vb. C#. But the reality is that they are very similar and generally, if one suits your needs, the other will. One big advantage to C# is that it uses the much more common C-style syntax which so many other languages do. Learning that will help you out if you want to move to C++ or Java in the future. (I use VB.) As far as how long VB.Net will be around, just consider how long non-.Net VB has been around, and how long Q-Basic has been around. This is just the next step. This step, however, unifies VB, Java (J#), and the new C#, along with managed C++ and other emerging .Net languages, which might provide them all with a boost of longevity. You are going to have a while to make the transition. Microsoft might have dropped support, but non-.Net VB software will still run for quite some time to come. Still, the transition should be made. You don't see many professional Q-Basic programmers today. To be certain, some day we will be able to say the same about non.Net VB.
  20. To the best of my knowlegde this is correct. From MSDN (ms-help://MS.NETFrameworkSDKv1.1/cpguidenf/html/cpcontargetingnetframeworkversion.htm):
  21. I found this on this page when I searched google for vb.net "com wrapper". Hope it helps.
  22. What I generally do is use a static property like so: Public Class Form1 Static _Inst As Form1 Public Sub New() 'ADD this to the existing constructor code 'Store a static reference to the main form _Inst = Me End Sub Public Shared ReadOnly Property AppInstance() As Form1 Get 'Return the main form Return _Inst End Get End Function End Class 'To close the application: Form1.AppInstance.Close() public class Form1 : System.Windows.Forms.Form { static Form1 _inst; public Form1() { // ADD this to the constructor _inst = this; } public static Form1 AppInstance { get { return _inst; Form1.AppInstance.Close(); } } } // To close the app, [/Code]
  23. If option strict is enabled, that should cause a compiler error. If option strict is off, that should convert fine. I recommend turning option strict on, however, to catch other similar potentially harmful errors. I don't understand that code. I also don't know sockets, but it looks like that code will just continually create new Client objects, adding handlers, and adding them to a collection in an infinite loop. Not something you normally want to do... Did you copy and paste that exactly?
×
×
  • Create New...