Jump to content
Xtreme .Net Talk

mooman_fl

Avatar/Signature
  • Posts

    194
  • Joined

  • Last visited

Everything posted by mooman_fl

  1. Hmmm... just changed it to: Public Shadows Property Text() As String Get Return strHeaderText End Get Set(ByVal Value As String) strHeaderText = Value Header.Text = strHeaderText End Set End Property All that seemed to do is break it. It still doesn't show at designtime in the IDE property list. It does still show in intellisense. However using it programmatically no longer changes the text at all. Still needing help with this.
  2. I am wanting to add the Public property Text() to my usercontrol. It obviously can't be added as a regular property. When I try adding it the normal way I am given an error saying it Shadows an overridable method in a base class. So I tried this: Public Overrides Property Text() As String Get Return strHeaderText End Get Set(ByVal Value As String) strHeaderText = Value Header.Text = strHeaderText End Set End Property This seems to work fine when changing the property programmatically (i.e. It shows up in the intellisense list) but the property doesn't show up at designtime in the property list. What am I doing wrong? Also a brief explanation as to why it is wrong will help me from making the same mistakes later.
  3. Actually I won't take exception with them for assuming that since in the past it has been very true concerning Microsoft... and many other software companies. Windows 95 - ME were VERY unstable with regular crashes. Sometimes several in one day or even one session. However I will be quick to tell anyone that this is NOT the case with Windows XP and certainly not witn .NET.
  4. Well I haven't really done the reaserch on it, but I can say from personal experience using .NET with Windows XP that it seems remarkably stable. I have really had no issues with .NET outside of the learning curve.
  5. Anyone know on this? I am still needing help on this problem.
  6. No intrusion at all. Sorry I didn't answer before but for some reason I wasn't notified that there had been a new post to this thread. I am glad you found your answer. :-)
  7. Hooks as you might know it from VB6 isn't necessary in .NET. You will have to be a little more specific about what you don't understand from divil's tutorials. I used his tutorials in the last week to figure this out in my own program. I would be glad to help but I will need to know what specifically you need help with.
  8. Heiko beat you to it this time divil <g> Thanks for the answer though. You are both right though. Heiko caught both parts of the problem though. (Only the last two. CollapseLineLeft is a simple Panel control so BackColor is definitly instatiated) This is what I get for not sleeping in over 24 hours. I left out this line: myGraphics = Graphics.FromHwnd(CtrlHandle) I think I better head to bed before I try to save my work and accidently reformat my drive instead. LOL
  9. BTW... if you are wondering why some values are not used in the sub it is simply because I hadn't implemented them yet. I was trying to test the line placement before I did rectangle fills to clear areas of the control.
  10. In making my usercontrol I have found it necessary to use the System.Drawing class to draw some areas on my control. Up till now this has been going great. I made a new friend class MooGraphics and put in some Enums and Methods to make it easier to use from my program since many of the drawing task are repetitive. Calls to these methods in my class were called once from Initialize (after all other initialization) and once in Paint. Pretty standard. All of my calls have gone as expected until I added this line to the DrawOpen sub: Moo.LeftLines(CollapseLineLeft.Handle, bIsCollapsed, CollapseLineLeft.BackColor, 3, 3) Moo is an instance of my class. CollapseLineLeft is the control I am drawing to, and bIsCollapsed is a boolean to tell if my Control is collapsed or not. The above line calls this sub from my class: Public Sub LeftLines(ByVal CtrlHandle As System.IntPtr, ByVal Collapsed As Boolean, ByVal FillColor As Color, ByVal x As Integer, ByVal y As Integer) Dim myGraphics As Graphics Dim Shadow As New Pen(Color.FromKnownColor(KnownColor.ControlDark)) Dim Highlight As New Pen(Color.FromKnownColor(KnownColor.ControlLightLight)) If Collapsed = True Then myGraphics.DrawLine(Shadow, x, y, x + 5, y) myGraphics.DrawLine(Highlight, x, y + 1, x + 5, y + 1) myGraphics.DrawLine(Shadow, x, y, x, y + 5) myGraphics.DrawLine(Highlight, x + 1, y + 1, x + 1, y + 4) Else myGraphics.DrawLine(Shadow, x, y, x + 5, y) myGraphics.DrawLine(Highlight, x, y + 1, x + 5, y + 1) myGraphics.DrawLine(Shadow, x, y, x, y + 5) myGraphics.DrawLine(Highlight, x + 1, y + 1, x + 1, y + 4) End If myGraphics.Dispose() End Sub What is happening is after I compile (no errors with Option Strict enabled) and try to add the control to the startup project is an error: An exception occurred while trying to create an instance of ToolScroll.ToolPanel. The exception was "Object reference not set to an instance of an object." If I REM out the call to Moo.LeftLines it will add just fine. I am not doing anything different that I can tell in that sub that I am in my other drawing subs... but the others work just fine. What could be causing this?
  11. Thanks alot divil... that did it. Well now to finish up my control. It will be a free .NET control to mimic the scroller control and collapsable groupboxes used in 3D Studio Max. I will release it and post a link in a day or so when it is done.
  12. Well that seemed to do it. It just gets confusing when all other changes you make show up in the IDE on your project but that doesn't. On a side note... what is the best way to add a toolbox icon to your control? I have another control in the same DLL that WILL show in the toolbox.
  13. BTW.... I did try it with the Class set to Public like the example I showed you... either way it didn't work.
  14. All the sources that I have looked up on this show the ToolBoxItem(false) implemented like this: <ToolboxItem(False)> _ Public Class ToolPanel However when I do this it still shows up in my toolbox... I have saved, rebuilt, and even closed down the IDE and reopened it. Below is my actual code: Imports System.Windows.Forms.Design Imports System.ComponentModel <ToolboxItem(False)> Friend Class ToolPanel Any idea what I am missing or what I should be looking at?
  15. Already tried that approach since that worked to keep other classes I had from showing up for the end user. While it keeps the control from being used on a form... it still shows up in the toolbox.
  16. Right now I am working on a DLL that consist of several UserControls. At the moment they all show in the toolbox at design time. One of the controls however I want to be internal only. (ie... only usuable from within another control and not sepearately.) To clarify this... I have a control (ToolScroll) that will be able to add the second control (ToolPanel) to itself dynamically at design time (via designer) or runtime (via exposed methods). However I don't want the Toolpanel available in the Toolbox. I only want this control to be availble second-hand through the Toolscroll control. Anyideas? I tried just declaring the ToolPanel class as Private but was told that this could only be declared inside another type.
  17. Ok... that did the trick. LOL Pretty basic and I have done that type thing before. Now I will know what someone means when they say add an Assembly reference. LOL
  18. I agree that the tutorial makes the concept easy to grasp. I am still having trouble though. I am trying to implement a designer in my own control project that I was already working on. Below is the code that I added to this project to start a designer for it (code for the control is collapsed since it should be unecessary for this example): Imports System.Windows.Forms.Design Imports System.ComponentModel + <Designer(GetType(ToolPanelDesigner))> Public Class ToolPanel... - Friend Class ToolPanelDesigner Inherits ControlDesigner End Class The problem is that "ControlDesigner" is underlined in blue and the tool tip says it is not defined. Everything else seems to be ok. What am I missing? Just for reference I tried cutting and pasting the example code on divil's tutorial to a new project and got the same thing. (I am using Enterprise Architect)
  19. Welcome to the community rgould. Still learning stuff here myself but if I can be assistance let me know. LOL
  20. If you want a good set of tutorials with lots of basic code on GDI+ then try this page: http://www.informit.com/content/index.asp?product_id=%7B00C5C1E2-C529-441E-882D-FCF15A71B7F8%7D Read it thoroughly and actually use the example code and study it. It is really helpful in picking up this subject. They do what you were asking about (displaying bitmaps on forms) but that is handled somwhere in the neighborhood of chapter 5 or 6.
  21. Having a little trouble with some code I am working on. I have never worked with GDI or GDI+ before so this is a little new to me and I am not sure what I am missing. I am sure it is probably something basic. Found a tutorial at this site . That explains the GDI+ basics. What I am trying to do is make a test program that will make 3 lines on a panel control.... when the mouse is over a line it will change lable1.text to true. Later I would add code that would additionally tell me what line the mouse was over as well. I can get the lines drawn... I think I have the regions set correctly. The tutorial mentions that you can do a hit test by using the Region.IsVisible method. I tried that passing the current mouse coordinates in the panel control to the method to compare but it doesn't seem to detect the hit when passed over a line. Attached is my code... any help is appreciated. windowsapplication9.zip
  22. Actually I am using version 6. What version of windows do you have? My mistake... I just looked it up to double check that... Microsoft.mshtml version 7.0.3300.0
  23. I sure didn't. Of course I am still looking for an answer myself and would appreciate any help that could be given on this issue.
  24. Ok... back again with a sample program. Hopefully you can get something useful out of this.windowsapplication9.zip
  25. Actually it absolutely CAN be done... unless I am misunderstanding what divil is talking about... but you don't get intellisense showing anything else except GetType when you try to use the array as the object. The object properties are there you just can't see them in the intellisense box and will have to know them and type them manually. Not sure why this is so. I will attach a project in a minute that demonstrates this. I already did a small test to make sure it worked first but need to clean it up a bit and add a few things to give a good demonstration. In your original post you were talking about something like: myarray(1).text = "Hello there" At least this is what I thought you were talking about... that is what my demo will be based on. After rereading though I realized that one of your ideas divil is right on as far as I can tell... you can't reference the text property of the control directly to the array... but you can accomplish the same thing by using the array as the object itself.
×
×
  • Create New...