Jump to content
Xtreme .Net Talk

divil

*Gurus*
  • Posts

    3026
  • Joined

  • Last visited

Everything posted by divil

  1. You do know the .NET richtextbox has a GetCharFromPosition method, right?
  2. const int DM_PELSWIDTH = 0x80000; const int DM_PELSHEIGHT = 0x100000;
  3. Anything that implements ISerializable can control its serialization very precisely. It's probably worth looking up the interface in the help and see if it gives you a list of classes that implement it.
  4. Look in to serialization, which is converting an object to data which is persistable. The Bitmap class has a custom serializer/deserializer which can operate on a byte array of bitmap data rather than serialized data describing the class itself, that's how it works.
  5. You said you wanted to make your class exandable in the propertygrid, which indicates it's going to be exposed as a member of another class.
  6. Why are you here?
  7. divil

    colour picker

    You can use ControlPaint.Dark and ControlPaint.DarkDark to calculate different shades of a colour. Or you can go the manual route by modifying the RGB or HSL values.
  8. Rumour has it they use Guinness to strengthen road surfaces around here...
  9. Check out e.Delta that's passed to the handler.
  10. You have to combine values: Dim myStyle As FontStyle If CheckBoxBold.Checked Then myStyle = myStyle Or FontStyle.Bold If CheckBoxItalic.Checked Then myStyle = myStyle Or FontStyle.Italic If CheckBoxUnderline.Checked Then myStyle = myStyle Or FontStyle.Underline txtSample.Font = New Font(txtSample.Font, myStyle) Try something like that.
  11. Edit and continue is (apparently) a high priority for MS with .NET and we might well see it in the next major release of VS.NET.
  12. It's there, but for some reason it's hidden. You can look up the signature for it in the object browser or the help and create your own handler method.
  13. I can't find such a method or property anywhere in .NET.
  14. Your application is fully compiled whenever you press Run, you'll find your exe in the bin subdirectory of the directory with all the project files in.
  15. Here's a working example I knocked up (replace the bitmap and drawing code with your own, obviously): 'Offscreen bitmap Dim offscreen As New Bitmap("c:\bmp205.bmp") Private Declare Function BitBlt Lib "gdi32" Alias "BitBlt" (ByVal hDestDC As IntPtr, ByVal x As Integer, ByVal y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hSrcDC As IntPtr, ByVal xSrc As Integer, ByVal ySrc As Integer, ByVal dwRop As Integer) As Integer Private Declare Function CreateCompatibleDC Lib "gdi32" Alias "CreateCompatibleDC" (ByVal hdc As IntPtr) As IntPtr Private Declare Function DeleteDC Lib "gdi32" Alias "DeleteDC" (ByVal hdc As IntPtr) As Integer Private Declare Function SelectObject Lib "gdi32" Alias "SelectObject" (ByVal hdc As IntPtr, ByVal hObject As IntPtr) As IntPtr Private Const SRCCOPY As Integer = &HCC0020 ' (DWORD) dest = source Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click 'Create the target graphics and get an hDC from it Dim targetGraphics As Graphics = CreateGraphics() Dim targethDC As IntPtr = targetGraphics.GetHdc() 'Create an offscreen dc and select our bitmap in to it Dim offscreenhDC As IntPtr = CreateCompatibleDC(targethDC) Dim oldObject As IntPtr oldObject = SelectObject(offscreenhDC, offscreen.GetHbitmap()) 'Blt a load of stuff (icons in this case) from it Dim i As Integer For i = 0 To 360 Step 24 BitBlt(targethDC, i, i, 24, 24, offscreenhDC, i, 0, SRCCOPY) Next 'Select our bitmap out of the dc and delete it SelectObject(offscreenhDC, oldObject) DeleteDC(offscreenhDC) 'Release the target hDC targetGraphics.ReleaseHdc(targethDC) targetGraphics.Dispose() End Sub
  16. It depends what's changing I suppose. If you just have a new exe file with no new dependancies, then yeah, just replacing it will be fine.
  17. Is there some reason you're not using ADO.NET?
  18. Controls have a MouseWheel event.
  19. 1. System.Reflection.Assembly.GetExecutingAssembly().GetName().Version 2. Pretty easy, you can read an xml stream bit by bit using XmlTextReader or you can load it all at once and query specific nodes for the information you're after. Use the WebClient class to actually download the file. 3. Is the only hard part, a common method is to create a loader program which first checks if a never version has been downloaded (to a temporary file name), and if so deletes the original exe and replaces it with that file. The file is then run.
  20. On any machine which is running the executable from a network share.
  21. I think you'll have to inherit so you can expose the underlying Socket as needed.
  22. You combine values using the Or operator: myClass.IsolationLevel = IsolationLevel.Chaos Or IsolationLevel.ReadCommitted
  23. I do know that .net code access security by default prevents you doing lots of things while running from a network share. You can use the tools in Control Panel -> Administrative Tools -> .NET stuff to give the assembly full trust on the machines.
  24. Use a regular listbox, and write code using System.IO.Directory.GetFiles() to grab all the files in that directory in to a string array. You can then loop through that string array adding them all to the listbox. You can get just the filename portion using System.IO.Path.GetFilename().
×
×
  • Create New...