Jump to content
Xtreme .Net Talk

divil

*Gurus*
  • Posts

    3026
  • Joined

  • Last visited

Everything posted by divil

  1. In C# when you use the cast notation it calls the string's implicit cast operator, which just uses the number's ToString() method. When converting from a numeric to a string I always use this method so equivalent IL should be generated.
  2. See the IsInputKey method in MSDN, you'll have to override it.
  3. Why do you need this?
  4. If that was what was happening there, I wouldn't have thought the process would have exited.
  5. True transparency (and translucency) doesn't exist for child windows (buttons, user controls etc) in the win32 world.
  6. The MSChart control has a method which copies its graph to the clipboard as a windows metafile. You should be able to extract that metafile from the clipboard using .NET and save it using the Bitmap class's Save method.
  7. I can confirm the framework sdk does come with the C++ .NET compiler. You will find it in Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin And yes, this is without visual studio installed.
  8. You should be inheriting System.Windows.Forms.Button
  9. I think we're done with this topic. We've already covered the reasons why it won't be implemented yet, and you know that if a significant number of that sort of question (that really _could_ live in a game programming forum) are asked, we're likely to create one.
  10. You could calculate the positions of the pixels that make up the line and follow them, comparing the mouse cursor's position to see if it's within a set distance from that pixel.
  11. [mshelp]ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/cpguide/html/cpconimplementingtypeconverter.htm[/mshelp]
  12. I don't understand the question. If you make a class inherit from button, it'll be a control not a component. It should be visible in the toolbox if you build a control library then add it manually.
  13. You can either make your property an enumeration, or implement a typeconverter for the type that overrides GetStandardValuesSupported. There's more info on that in MSDN.
  14. You can't make them directly available. If you want to expose events of child controls, you'll have to wrap them in your own events.
  15. You can't reliably change the mouse cursor for the whole screen.
  16. He's asking how to use the visual studio command window. You use it to run functions and see their results at runtime.
  17. Being able to add stuff to a 3D shooter via managed code is a pretty cool idea. It would make mod writing and all that stuff a lot easier, and code access security could even help stop cheaters.
  18. Private Declare Function GetPixel Lib "gdi32" Alias "GetPixel" (ByVal hdc As IntPtr, ByVal x As Integer, ByVal y As Integer) As Integer Private Declare Function GetDC Lib "user32" Alias "GetDC" (ByVal hwnd As IntPtr) As IntPtr Private Declare Function ReleaseDC Lib "user32" Alias "ReleaseDC" (ByVal hwnd As IntPtr, ByVal hdc As IntPtr) As Integer Private Sub Panel1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseMove Dim hdc As IntPtr = GetDC(IntPtr.Zero) Dim p As Point = Panel1.PointToScreen(New Point(e.X, e.Y)) Dim c As Integer = GetPixel(hdc, p.X, p.Y) Dim color As Color = ColorTranslator.FromOle(c) ReleaseDC(IntPtr.Zero, hdc) Panel1.BackColor = color End Sub That'll do it. Click on the panel and you can drag over the whole screen, the panel's background colour will change as you move over different coloured pixels.
  19. You should redraw the entire scene every time, that's just how it's done. Drawing 110 32x32 objects shouldn't slow things down too much, if this is a windowed GDI+ game.
  20. divil

    Dos

    Go to http://www.go-mono.org for the Linux implementation of .NET. As far as I know console programs should run just fine.
  21. Throw New OutOfMemoryException() That's how to generate the exception, if you're talking about actually bringing your system to its knees with excess memory consumption, I don't know what to suggest apart from writing a program that uses progressively more and more of it without releasing any.
  22. Yeah, get a better IDE :P Seriously, all you have to do is embed the icon in your project and then retrieve it at runtime and assign it to the form. SharpDevelop's Form Editor should take cake of this for you - if it's not, I would suggest posting on their forums as this seems to be an IDE issue.
  23. windows\microsoft .net\framework\version
  24. I think the Microsoft C++ .NET compiler comes with the framework sdk.
  25. See Activator.CreateInstance()
×
×
  • Create New...