Jump to content
Xtreme .Net Talk

divil

*Gurus*
  • Posts

    3026
  • Joined

  • Last visited

Everything posted by divil

  1. Yeah, I get that effect too. The text doesn't seem to want to draw properly.
  2. You can get a Point structure of the mouse pointer's position relative to the upper-left corner of any control using this method: myPoint = myControl.PointToClient(Cursor.Position) That might help you get further, but you'll still have to adjust for your scaletransform I guess.
  3. The way to properly bring a tab page to the front is with the SelectedIndex property of the parent tabcontrol. If you know the tabpage you want, you could do something like this: myTabControl.SelectedIndex = myTabControl.TabPages.IndexOf(myTabPage)
  4. When you originally posted this thread I had a quick go at doing what you're doing, and to get the selection border I had to do the following: - Listen for the SelectionChanged event from ISelectionService (you're probably already doing so) - Force any radiobutton that should (or shouldn't anymore) have a selection rectangle to repaint itself - In your RadioButton designer, override OnPaintAdornments. Then use ControlPaint.DrawSelectionFrame to draw the selection frame on top of the control's normal graphics.
  5. 'To restrict: Cursor.Clip = New Rectangle(0, 0, 400, 300) 'To unrestrict: Cursor.Clip = Rectangle.Empty
  6. In C#, the string used to access embedded resources (I think) is DefaultNamespace.FileName, where DefaultNamespace is specified in your project properties.
  7. Dim d As PropertyData For Each d In wmi.Properties 'etc Next Something like that, maybe?
  8. To show a form, you must first create an instance of it: Dim f As DataForm1 = New DataForm1() f.Show()
  9. Since these are real controls you are hosting, a great deal of my article doesn't apply. All the CalculateLayout function need do in your case is to set the position of the radiobutton controls once you've added them with Controls.Add. By default, the radiobuttons will have a ControlDesigner associated with them, so they will be selectable and you'll be able to edit their properties in the propertygrid. However you probably won't see the selection rectangle because your parent control designer won't inherit from ParentControlDesigner.
  10. What behaviour do you want the radio buttons to have? You should be able to host them on the design surface if you've created them with a call to CreateComponent on IDesignerHost. You can add them to your control with Controls.Add.
  11. If he's trying to write the code in the form itself, he doesn't need a withevents - he should just select Base Class Events in the left combo box and Paint in the right.
  12. The size needs to be larger, I preferred it how it was.
  13. The first step is going to the project menu and adding a new User Control. Once that's code, you should be able to add two properties to it and respond to the MouseEnter and MouseLeave events (NOT Enter and Leave events) in the control to give the control the right images. This will also make the control designable, you'll be able to drop it on to your form from the toolbar and choose the images in the propertygrid like you would in, say, a picturebox.
  14. I wasn't referring to MouseDown and MouseUp, there are actually MouseEnter and MouseLeave events for every control.
  15. If you are not using any of the .NET class library, and you are not using the /CLR switch on the compiler, then you should be alright - your app will run on machines without .net installed. Otherwise, you'll need the framework.
  16. If you make yourself a new control, and give it two image properties, it should be a fairly simple matter of drawing whichever one you need to. If you get stuck with a specific problem doing this, post it here.
  17. You should, really. The white on blue is configuration in the display settings, so any user that doesn't like that highlight colour is free to change it, and probably already will have.
  18. You didn't include some necessary files. It's worth noting, though, that .net controls have both a MouseEnter and MouseLeave event, thus greatly simplifying your task.
  19. If you're using Graphics.DrawImage to draw them, you could use the ImageAttributes class together with a ColorMatrix to give the second one an alpha component of 0.5. That way, you'd see right through it to the first.
  20. A friend showed this to me a couple of weeks ago. It's quite impressive... until you figure out how it works :)
  21. You can't assume the index will be the same. Indexes start at 0 for each group of nodes under a parent. One way of doing this would be to assign a corresponding treenode to the Tag property of a ListViewItem, then casting it when required: DirectCast(lvw.FocusedItem.Tag, TreeNode).Expand()
  22. Would a better solution be to set the richtextbox's Multiline property to false?
  23. I don't think so. I don't recall vb6 having that limitation either, although I asked a friend and he recalls something about the old VB6 IDE not being able to handle files over a certain size.
  24. The easiest way is to alter the constructor of one form so it accepts an instance of the other form. That way it has a handle around in memory that it can always refer to, if it needs to access any members on the first.
  25. Your code when creating the form should read as follows: private void menuItem2_Click(object sender, System.EventArgs e) { Form2 newMDIChild = new Form2(); newMDIChild.MdiParent = this; newMDIChild.Show(); } You were trying to refer to an "MDIParent" property. Remember that c# is case-sensitive.
×
×
  • Create New...