Jump to content
Xtreme .Net Talk

Volte

*Experts*
  • Posts

    2372
  • Joined

  • Last visited

Everything posted by Volte

  1. You'll need to repost the demo project as code files rather than a binary, since that is against the rules and it was removed by a moderator.
  2. The Splitter bar *is* invisible, unless you set the borderstyle. There's nothing to show. The only reason it sometimes looks 3D is that there are two sunken controls on either side of it. Other than that, I don't know what you mean be the mouse-events are only processed by the first one. Can you give an example of this functionality?
  3. A DLL which is created in .NET is not a COM component, it is a .NET component, and as such is not directly callable from VBA. You need to create a new Class Library project, give the class the ComClass attribute, specify GUIDs using the GUID Generator, and tell the compiler to mark the DLL for COM Interop. When all is said and done, you will have two files: a standard .NET DLL, and a TLB TypeLib that can be referenced by VB. You won't really have a COM component, just a wrapper to a .NET component which will still require the .NET framework. The process takes a bit of time, and it is fully documented in a MSDN. Just search for COM components in your MSDN and you should find something about creating them.
  4. You can't embed the manifest using .NET resource files, I don't think. Windows only lets you do it with the standard .RES files that C++ and VB6 and the like generate.
  5. Humour is a great thing, but it shouldn't direct a thread's focus off course. I think it's best to (in the programming related forums) make sure your post has some technical merit, though, and not simply make joke posts.
  6. What do you mean "when running it from textpad"? When any program at all compiles and runs it, it generates a usable EXE...
  7. Is the .exe.manifest file in the same directory as the EXE?
  8. There is other stuff you need to do, too, like use the GUID Generator to make you GUIDs for the COM object, the typelib, etc. You also need to make sure you give your class the ComClass attribute. Read the MSDN for more info.
  9. You can put that in a static sub in a class, though.
  10. Control arrays no longer exist in .NET; you can make arrays of controls, but only through code, like so:Dim myLabel(6) As Label Dim i As Integer For i = 0 to 6 myLabel(i) = New Label() With myLabel(i) .Location = New Point(10, i * 18) .Size = New Size(150, 18) 'other property settings and stuff End With Me.Controls.Add(myLabel(i)) Next
  11. Volte

    If Or

    Nothing wrong with that, except you should use the logic OrElse operator.If a = b OrElse a = c OrElse a = d OrElse a = e Then
  12. Nothing is wrong with static methods. If you are making helper classes or whatever, it's best to be able to do this: gs = ColorHelper.ToGrayScale(Color.Blue);rather than having to do this: ColorHelper ch = new ColorHelper(); gs = ch.ToGrayScale(Color.Blue);So you'd make ToGrayScale static. Another good spot for static methods is in non-creatable classes and structures... for example, you can't create a new Graphics object, but you can use the shared methods of it to get one. Graphics g = Graphics.FromHdc(); I can't think of any time you'd use a singleton (that is a class in which only one instance can ever be used) over a static class.
  13. You could do this:for (int i = 0; i <= 26; i++) { String lc = Convert.ToChar(i + 97).ToString(); String uc = Convert.ToChar(i + 65).ToString(); // Replace twice so that triplets are reduced to 1: // 1) aaaaaa -> aaaa // 2) aaaa -> a myText = myText.Replace(lc + lc, lc).Replace(lc + lc, lc); myText = myText.Replace(uc + uc, uc).Replace(uc + uc, uc); }A bit hackish I suppose, but it should work (I haven't tested it though).
  14. The only reason I removed references to the external icons is because I don't have them, and it wouldn't run with them referenced. They would in no way affect OpenDialog.
  15. After removing all references to the external icons and stuff, it compiled file and the "Load" menu item worked fine. [edit]Yay, 1200 posts[/edit]
  16. The one that's under his message. Between PM and SEARCH.
  17. wyrd: Adobe Photoshop is about $625 USD. :p
  18. What do you mean by that Nerseus? Fields aren't wrappers for anything, they are just class-level variables, and as such, they have their own attributes (Public, Assembly, etc). You can also check to see if the field is an enum item by seeing if the field's DeclaringType is Enum (with fi.DeclaringType.IsEnum). You can use fi.IsLiteral AndAlso fi.IsStatic to check to see if it's a constant. I will be releasing an Object Browser in the near future in the Code Library which acts like the .NET internal Object Browser and it will show how to do all of this.
  19. Looks like you're correct... I guess I was forgetting that Buttons have 'Text' properties too (not 'Caption' a la VB6).
  20. Actually in my example, the enumerator control is a TextBox, so it doesn't matter what I search on, because it will only look through the TextBoxes. As long as the property I check belongs to TextBox, it's fine.
  21. Properties are sort of misleading; there really are no such things as "properties" interally. Properties are just made of up two accessor methods (or one, if it's read/write only) called get_MyProperty and set_MyProperty. You'll need to get both of these and get *their* visibility. Here is a method I used in one of my programs to get the visibility: Public Shared Function GetPropertyVisiblity(ByVal pi As PropertyInfo) As Integer Dim mSetMethod As MethodInfo Dim mGetMethod As MethodInfo Dim mCheck As MethodInfo 'If the property is not write-only, get its "Get" method If pi.CanRead Then mGetMethod = pi.GetGetMethod(True) 'If the property is not read-only, get its "Set" method If pi.CanWrite Then mSetMethod = pi.GetSetMethod(True) 'If there is no "set" method, use the "get" method, and vice versa If mSetMethod Is Nothing Then mCheck = mGetMethod ElseIf mGetMethod Is Nothing Then mCheck = mSetMethod Else mCheck = mSetMethod End If 'Get the attributes of the method Dim mAttr As MethodAttributes = mCheck.Attributes And MethodAttributes.MemberAccessMask 'Check its visibility If (mAttr And MethodAttributes.Public) = MethodAttributes.Public Then Return 1 'public ElseIf (mAttr And MethodAttributes.Family) = MethodAttributes.Family Then Return 2 'protected ElseIf (mAttr And MethodAttributes.Assembly) = MethodAttributes.Assembly Then Return 3 'internal ElseIf (mAttr And MethodAttributes.Private) = MethodAttributes.Private Then Return 4 'private End If End FunctionI changed it a bit for your purposes (mine returned an Enum type specific to my program), but the functionality is there.
  22. The easiest way to do this would probably be like this:Dim txt As New TextBox() Dim tbReference As TextBox For Each txt In Me.Controls If txt.Name = "txtName1" Then tbReference = txt End If Next 'At this point in your code, [b]tbReference[/b] will reference the control you want. 'Just use it like you would a normal control.
  23. Anything other than GDI+ and you'll have to do it manually (except for maybe DX, but from the past GDI+ vs. GDI vs DX discussions we've had, I gather you're not using that).
  24. Use the Graphics.InterpolationMode property.
  25. You'll need to use IO.BinaryReader to read a binary file. StreamReader won't do it properly I think.
×
×
  • Create New...