Jump to content
Xtreme .Net Talk

rbulph

Avatar/Signature
  • Posts

    398
  • Joined

  • Last visited

Everything posted by rbulph

  1. Is there any easy way to show a control (textbox, combobox) as if it is enabled, but not actually have it enabled? I want to show the controls as a sample which I don't want the user to be able to edit, but at the same time I don't want the controls to have the greyed out appearance which they get when disabled.
  2. Is there any automated way to cut out all superfluous blank lines from my code, i.e. so that there are never two consecutive blank lines? I've found the "Delete Horizontal White Space" command, but nothing comparable for vertical white space.
  3. Ctrl + F is "Quick Find" on the version I have. I don't have anything called "Quick Search". If there's a Firefox like search tool you'd better figure out exactly how you got it and let us know!
  4. OK, "Quick Find" is alright. But I still think "Find in Files" is a confusing name. It should be named to reflect the style of its output, not where it searches, since the former is how it differs from Quick Find. And the idea of finding "symbols" is new to me. Would I be right in thinking the idea is so that you can find variable or procedure names so as to avoid conflict between them when naming a new one?
  5. OK, thanks. The code is more of a subsection of the form's code than something logically separate, so I was hoping just to be able to display it by itself so that I could review it without being distracted by the other code of the form. But I could think of a way to move it out, so I guess that's what I should do.
  6. Is it just me or is the naming of the different file options completely bizarre? You can do: Find Symbol which means find the text in the specified places and give a clickable list of all occurences, Find in Files which means find the text in the specified places and give a text style summary of where it has been found, and Quick Find which means find the text in the specified files by going to each occurrence in turn. Quick Find is the slowest, Find Symbol has nothing to do with symbols and all three methods find occurrences in files, not just Find in Files. The difference between the methods is in the output and not in any of the things that their names would suggest. Isn't this just stupid?
  7. How do I do partial classes? I've got a form which has a body of code which is logically a separate block, and I'd like to be able to view that block by itself. So I decided to put it into a partial class. This works OK, except that if I have it in the same module as the form, the form's designer won't show. If I have it in a separate module the form's designer will show but if I double click on that module vb creates an extra designer (a basic form) and inserts initialization code in my module for it. And then I can't open the designer for the form again. Hmm.
  8. And which member of the Cursors collection are you saying is the dragdrop cursor?
  9. I'd like to be able to allow the user to select objects from a range of toolstripbuttons and add those objects to a picture box in two ways: 1. By a normal dragdrop procedure from the button onto the picture box. That's easy enough to achieve. 2. Secondly I'd like to allow him to do add the object by clicking the button, so it is selected, and then clicking on the picture box. That again isn't too hard, except that he needs some visual feedback through the cursor to show that an object is going to be added if he clicks on the picture box, and I'd like to use the dragdrop cursor for that, for consistency. But I can't - if I initiate a dragdrop procedure when the mouse isn't down, the drop occurs as soon as the mouse moves over the picture box, so the cursor only shows for an instant. Any thoughts about how to get this cursor showing when I want it to?
  10. Yes, you're right, usually this works OK. So after a bit of playing around I figured out what is causing it for me - it's my use of the SetScrollInfo API. If I take that out I don't have the problem. Why this should have the described effect I've no idea, but I think I can work around it by activating the form on its MouseDown event etc.
  11. I'm surprised that, at runtime, if you click on an MDI child form or select one of its controls, it doesn't get activated, i.e. its caption bar remains the same colour and the MDI's caption doesn't get changed. I thought activation of a form in this manner was standard behaviour - if you look at Word for instance you will see that the form does get activated. So is there a very simple way to achieve this effect? I can use the form's Enter event, but that won't trigger if the user clicks on the form, only on a control that is capable of being entered. So any thoughts?
  12. The property always returns False.
  13. With a user control, or a class which inherits a control, how can I tell if the New() event is occurring in a designer at design time, or is occuring at run time?
  14. Thanks, I hadn't noticed the "Show All Settings" checkbox in the Options dialog, but now that I check that, I see what you're referring to.
  15. I'm using Visual Studio 2005 and it really annoys me that it has to show the Start Page first, because this entails downloading a list of articles on the web that VS thinks might be of interest to me, and of course I have to wait while it does this. Is there a way that I can get it not to show the start page? I've looked under Tools/Options, but couldn't see anything.
  16. OK, figured that would probably be the case. I think I'll achieve what I want by drawing right angles that are rounded at the corners. It doesn't seem that any one of the graphics methods will do this for me, so I'll just have to draw the two lines of each right angle a little bit short at the corners, and fill in the gap with a quarter circle. Time to get the trigonometry textbook out.
  17. There's rather a bewildering choice of methods to draw a curve. Do any of them allow me to draw a curve beginning and ending at known points, and specifying areas of the graphics object that the curve is to avoid? Or do I have to figure out points away from the areas to be avoided to cause the curve to avoid them?
  18. No, actually that's not what I'm trying to do. I want the data to be a Type object, not a control that's being dragged. On experimenting further I've found that you can do what I want with code like: Dim t As Type = e.Data.GetData(e.Data.GetFormats(True)(0)) to extract the Type that you sent in the DoDragDrop method. The format that the data is in is a WindowsForms10PersistentObject which I can't find in the object browser, and that's why I was having problems, but if you write the code in one line, and don't ever try to declare a WindowsForms10PersistentObject, then it seems OK.
  19. I'd like to send a reference to a type with a dragdrop routine, but can't get it to work. Any thoughts? Here's the code I'm using: Public Class Form1 Dim s As Type Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.PictureBox1.AllowDrop = True End Sub Private Sub PictureBox1_DragDrop(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles PictureBox1.DragDrop Dim f As Type f = e.Data.GetData(GetType(Type)) Debug.Print(f Is Nothing) 'returns True. How do I extract the Type from e.Data? End Sub Private Sub PictureBox1_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles PictureBox1.DragEnter e.Effect = DragDropEffects.Copy End Sub Private Sub Button2_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button2.MouseMove If e.Button = Windows.Forms.MouseButtons.Left Then s = GetType(class1) Button1.DoDragDrop(s, DragDropEffects.Copy) End If End Sub End Class Public Class class1 Dim x As Long End Class
  20. Thanks. I feel they have a valid complaint.
  21. Actually, here's quite an irritating bug - if you have a toolstrip at the bottom of a form, and the form is maximised and you move the cursor over a button in that toolstrip and leave it, you will see the tooltip for about half a second, and the button will lose focus, then the button will regain focus and the tooltip will disappear, and so on - VB gets stuck in a loop and it looks awful.
  22. In VB 6 you could toggle between viewing a single procedure in a module and viewing the whole module. In .net 2005, you have the option to close down any number of procedures so that just their first lines show by clicking on the little minus signs shown against them. But there doesn't seem to be any way to just view one procedure, which I find a shame. Or is there something I'm missing?
  23. Can't you just use a timer control with a very long Interval?
×
×
  • Create New...