Ok, I got tired of everyone complaining about the lack of a line control in VB.Net, so I created one. Will all of you please check it out and see how it works. I basically need a beta test of it to check to be sure it works correctly.
Some things to help you get started:
Right-Click on your toolbox and click customize toolbox. Click the .Net Framework components tab. Click the browse button to locate where you extracted the dll at. Double click it. The toolbox customizer should add it, and check it for you. It will now be in your toolbox to use. Look at the bottom.
Set the Angle property to get the desired effect needed.
After setting the Angle property, resize the control to get the angle and/or size you desire.
Set the LineWidth property to get a thicker or thinner line (float value).
Set the Color property to change the lines color.
Also, right-click the control and send to background if it overlaps any other controls.
Good luck all, and I am looking forward to your feedback...
The only problem I have found is that the background isn't opaque. I am trying to find a solution to this, and if anyone knows how, please do tell..lol.
Originally posted by hellswraith The only problem I have found is that the background isn't opaque. I am trying to find a solution to this, and if anyone knows how, please do tell..lol.
why do you need to do that? just override the resize event and make sure that the user can only resize the control lengthwise. wouldn't that work?
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB ) VB.NET to C# conversion tips!!
Originally posted by MrPolite why do you need to do that? just override the resize event and make sure that the user can only resize the control lengthwise. wouldn't that work?
That isn't the problem, the problem comes when they make the line at an angle. Then the 'square' area that the user control takes up becomes quite large. When the line is horizontal or vertical, everything is perfect.
hmm have you looked at SetStyle ()? there is an option for transparency, as far as I remember. btw you never told me why you're inheriting from Control and not UserControl? What's the difference?
another though: isn't it possible to draw the line on the form, rather than drawing it in the usercontrol? I know you can easily draw something on the form, but is it possible to draw a line that passes over all the controls in the form ?(basically like a line that has the highest ZOrder and is on top of some controls)
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB ) VB.NET to C# conversion tips!!
I have done the SetStyle already, but it doesn't work so well.
I thought about trying to get the graphics object of the form, and just directly drawing on it, but I couldn't figure out a way to get the graphics object from the form.
I forgot to tell you about why I was inheriting from control and not usercontrol. It is because the documentation said that if I am going to be drawing my control using the paint event, then to inherit from control.
Originally posted by hellswraith I forgot to tell you about why I was inheriting from control and not usercontrol. It is because the documentation said that if I am going to be drawing my control using the paint event, then to inherit from control.
I dont know the difference between control and usercontrol
anyways I tried this with a usercontrol and it compiled. I didn't actualy test it though. So I guess you can draw on the form this way. But I really don't know how to draw on the controls that are on the form
VB Code:
Private Sub UserControl1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Private Sub Form_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs)
End Sub
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB ) VB.NET to C# conversion tips!!
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB ) VB.NET to C# conversion tips!!