Jump to content
Xtreme .Net Talk

divil

*Gurus*
  • Posts

    3026
  • Joined

  • Last visited

Everything posted by divil

  1. Those two urls were just a selection of lots that you could put together to figure out how to make your own component. That would be a greal deal better than using an ActiveX control.
  2. Not identical - yours won't work :) The best way would be comparing Textbox1.Text.Length to 0.
  3. The built-in console class doesn't have this, but a Microsoft employee wrote a ConsoleEx class which I believe can do this and much more. http://www.gotdotnet.com/userarea/keywordsrch.aspx?keyword=consoleEx
  4. If ((ModifierKeys And Keys.Alt) = Keys.Alt) And ((ModifierKeys And Keys.Shift) = Keys.Shift) Then
  5. It looks like setting the DropDownMenu property of the button to the contextmenu, and also setting the Style property to DropDownButton achieves this effect. If you simply wanted the menu to appear in the button press, in code you can use the contextmenu's Show method.
  6. It's actually quite a bit of work to show the shell context menu for a file or directory, and I don't know of any examples for .net. Brad Martinez has this example for VB6 though, which you could port: http://www.mvps.org/btmtz/shellmenu/
  7. How else would it be performed? myCombo.BringToFront() :)
  8. Of course it does, you're explicitly creating a new instance. In some other thread I told you what to do to get around this. If you can't manage this, it's you're fault and not vb.net's. Orbity has been incredibly generous writing code to help you. I suggest hitting the books and/or documentation for a few days. Buy a VB.NET book and read it from cover to cover. Oh, and we don't do homework. You mentioned this was for your major assignment.
  9. I think you can find a powerful flexgrid for .net at http://www.componentone.com .
  10. Out of curiosity, can I see a screenshot of an app you've designed with a "sweet" interface?
  11. They stopped you being able to customize the colours of those controls for a reason. I recommend you leave them alone, or rewrite them from scratch if you need a wacky interface.
  12. I like it. It help stop people inflicting _really_ ugly toolbars and statusbars on the world :P Seriously though, windows controls are meant to look standard. If you go to enough trouble, you can change them.
  13. C# uses square brackets instead of parentheses for accessing Indexers and Arrays: string user = Session["userName"];
  14. Well, you should have something like this to declare your variable and in the ItemCheck event: Private ignoreListviewChecks As Boolean Private Sub ListView1_ItemCheck(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemCheckEventArgs) Handles ListView1.ItemCheck If ignoreListviewChecks Then Return 'Perform validation here End Sub And whenever you change a listitem's Checked property manually in code, surround the line by setting the variable to true: ignoreListviewChecks = True myListViewItem.Checked = True ignoreListviewChecks = False
  15. There isn't. If you want to change the colours of these controls you will have to draw them entirely by yourself, a very non-trivial task.
  16. Try this. Obviously, change the path to whatever bitmap you want to load and display. Private backgroundBitmap As Bitmap Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim c As Control backgroundBitmap = New Bitmap("c:\windows\coffee bean.bmp") For Each c In Controls If TypeOf c Is MdiClient Then AddHandler c.Paint, AddressOf PaintMyImage Exit For End If Next End Sub Private Sub PaintMyImage(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) e.Graphics.DrawImage(backgroundBitmap, 0, 0) End Sub
  17. It's very possible that setting the checked property raises the ItemCheck event. If this is the case, you'll have to use a form-scoped boolean variable to tell the code in that event not to run if you're setting it manually.
  18. This example shows creating an in-memory bitmap, drawing a circle on it, then assigning the bitmap to a picturebox. Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim b As New Bitmap(100, 100) Dim g As Graphics = Graphics.FromImage(b) g.DrawEllipse(Pens.Red, New RectangleF(0, 0, b.Width, b.Height)) PictureBox1.Image = b 'b.Save("c:\temp.bmp") g.Dispose() End Sub If you uncomment the commented line, the bitmap will be saved to the hard disk.
  19. Ok, now I think I get it. I had a feeling you were getting at that before but wasn't sure. Exactly what you're suggesting isn't possible. That is, the designer cannot get access to the underlying code of the form. Imagine, if someone used your component from, say, VB.NET and your designer was trying to parse C#? I have a better idea though. Create yourself a class that inherits from Component. That means that when it is dropped on to the form it will not be visible, it will be placed in the component tray. Use that class to manage the created models, and act as a container for them. You can expose this collection editing behavior however you like. Then, in your original custom controls, have a property that allows the user to bind it to a Manager class (that I just described). Once bound, there will be another property that allows the user to select from one of the models exposed in the manager's collection. You will be able to do this by writing a UITypeEditor that shows a dropdown list based on the bound manager's collection. You could skip having to bind the control to a manager manually by assuming that there will only ever be one manager per form, and walk the components list to find it instead.
  20. I'm still not entirely sure what it is you're trying to do - can you give an example which illustrates it? Try not to think of it as hooking in to source code - the designer architecture is a little weird at first but it's a lot like doing things at runtime - your form exists, and the controls on it are instantiated and running.
  21. itm.Checked = True That line itself should not cause an error. I am skeptical that it does. If indeed it does, make a sample application that reproduces the error and send it to Microsoft. Or, just post your whole project here (without binaries) and I'll see what I can do.
  22. We have a DirectX forum here, under graphics. If you go there, there is a sticky post with the url to the SDK. It's over 200 megs, if memory serves.
  23. The listview control that ships with the framework only has the support I said above for checkboxes, i.e. in the first column only, next to the text. It's possible you could ownerdraw it and add the behaviour, but it would be a non-trivial task.
  24. It sounds like you might want to investigate the UITypeEditor class, that's how you provide custom support for dropdown lists for propertes in the propertygrid, where the build-in behaviour isn't enough for what you need. There are a lot of articles out there that include using UITypeEditors.
  25. I think the listview itself has a CheckBoxes property, which (if enabled) will give each row a checkbox by the icon.
×
×
  • Create New...