Jump to content
Xtreme .Net Talk

Jaco

Avatar/Signature
  • Posts

    64
  • Joined

  • Last visited

Jaco's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I'm trying to set up a currency value column in a DataGridView (2005) and I'm following examples from Microsoft on how to do this, but the currency formatting is being ignored. Here's how the samples (from Microsoft) indicate how it's done: Dim col As New DataGridViewTextBoxColumn() col.DefaultCellStyle.Format = "C" 'also tried lower case "c", but no luck ... <other properties such as header text etc.> ... MyGrid.Columns.Add(col) But when values are set on that column, they appear as plain numbers, not currency (i.e., no '$', no comma, etc.).
  2. Thanks for your help. I've decided to use bitmap images for this now and it works fine - these aren't quite as nice as the icons I was using, but it's fine.
  3. Thanks for your help. They are icons that are stored in a .NET ImageList. They are then associated with a Farpoint Spread 3 control to display in various cells (I can't upgrade yet to the newer spread since it's too much work for phase I of the upgrade to .NET). Strangely enough the ActiveX control property expects a System.Drawing.Image even though it's an ActiveX control (or is that strange??). The icons do appear normal when associated with .NET controls such as the toolstrip.
  4. What would cause icons that appear normal in VB6 suddenly have a dark blue background in VB.NET ? The icons appear normal when examined in any image viewer (VS, Paint, etc.), but when used in an ActiveX control (which can't be upgraded yet) referenced from a VB.NET 2005 project they have an annoying blue background (same in VB.NET 2003 by the way).
  5. Joy at last !! For VB6 ImageList images originating from icons, the following code works: Dim test As stdole.IPictureDisp = Me.MyImageList.ListImages(1).Picture Dim testicon As System.Drawing.Icon = System.Drawing.Icon.FromHandle(test.Handle) Apparently that VB6.IPictureDispToImage method doesn't work when the underlying image is an icon - it would have been nice if there were any documentation to that effect! Thanks anyway to anyone who spent any time thinking about this!
  6. After some research, it appears that many people have a similar problem with the VB6.IPictureDispToImage function (leading to the "unknown image type" exception). None of the threads I found have any resolution to this. Any ideas on how to get this function to work?
  7. I've upgraded a large VB6 app to VB.NET. However, the VB6 ImageList doesn't upgrade to the .NET ImageList. That's fine - I'll just dump the same images to a new .NET ImageList. Easier said than done! I don't have the images anymore, just the old VB6 ImageList - how do I extract the images from a VB6 ImageList ?? The ImageList is working in .NET, but I need the images in a new .NET ImageList to associate with other .NET controls. Here's the code I was trying to use to recover one image as a test, but the second line causes an exception: Dim test As stdole.IPictureDisp = Me.MyVB6ImageList.ListImages(1).Picture Dim testimage As System.Drawing.Image = VB6.IPictureDispToImage(test) testimage.Save("C:\Temp\test", Imaging.ImageFormat.Bmp) Anyone have any idea how to recover the images?
  8. Has anyone noticed that the cursor on a RichTextBox context menu remains as an I-Beam when right-clicking when running on .NET 2.0? It only happens for RichTextBoxes and on .NET 2.0 framework. Running the same executable on 1.1 causes the cursor to switch to the arrow when right-clicking. I first thought it was a beta 2 issue, but it remains a problem. Any ideas on how to fix?
  9. At the risk of being labelled a total geek, it's actually: if (! ((objType.Attributes & TypeAttributes.Abstract) == TypeAttributes.Abstract)) ;)
  10. There is an equivalent with try/catch where the catch block is empty, but it may be impractical: Try statement 1 Catch 'no code (ignore exception) End Try Try statement 2 Catch 'no code (ignore exception) End Try As you can see, this is not a very elegant solution, but it works. As marble_eater says, ignoring errors is far from ideal.
  11. You haven't specified a return value in your example. You need either "Return res" or "Noise2d = res" at the end - otherwise the default value of the Single type is returned (0.0).
  12. From what I've seen, you wouldn't be the first to dislike this prospective "feature". I can tell you that I've literally wasted days cleaning up crappy VB6 code where junior programmers thought "variant" was a great idea. Non-typed variables was already a bad idea a decade ago. I seriously doubt it if this feature makes it to release.
×
×
  • Create New...