How to make entire Link Label area clickable? - c#

I've been trying to get to make the whole area clickable, in the picture you can see the size of the linklabel, but only text is clickable, I want to make the background of the link label(the whole area) clickable too, is that possible? How can I do that?
I've tried using
linklabel.LinkArea = new LinkArea();
But it only works for the text that i have. I've checked out StackOverflow Posts such as this or this but i couldn't get something out of it.

You can use a panel, with a mouseclick event on it, after that you can add a label or whatever you want
Panel

Related

A visuality gap between text box and it scroll bar

I'm creating my first windows forms app.
I've added a text box to the form and forced it to have a vertical scroll bar,
but it looks like there is a space between the text box and the scroll bar,
which of course does not look good:
AS you can see here
Appearance of the form
I've searched online and tried to "play" with the margins around the text box but i couldn't solve it
thank you.
I would try to resize the textbox (not in height but in length/width just to check if it changes anything). I had the same Issue once and could fix it with that.
~Fab

C# Windows Forms, painting combobox borders

We need to show our disabled comboboxes as an image. The image has the same height as the standard combobox, but for some reason it cannot override the borders of the combobox.
Instead, it end up looking like this:
We would like them look like this image, i.e. that the image is shown on top of everything - including the combobox borders:
Any ideas?
Thanks.
First of all, what you are trying sounds really dirty - the best way would be, if your ComboBox would just look like your image as soon as you disable it!
If there is really no other way:
Create a PictureBox in front of your ComboBox. Set the image as the PictureBox's image, make it Visible whenever you want to "disable" your ComboBox.
But again, using controls to simulate behaviour you would expect to be part of another control is dirty.
Get the location of you textbox, set it invisible, then a the same location place an imagebox

How do I select all text in a groupbox with the mouse?

Ok so I am trying to do something extremely simple but its turning out to be extremely complicated. I wanted to be able to select my text for all of my labels. Since you can't do that I had to convert them all to textbox's. Now that I have that done I want the user to be able to drag their mouse across an area on the form and select whatever text they roll over. A good example would be a web browser.
EDIT
Ok I need to make this a little more clear and what better than some imagery.
Look at the picture above. I cannot drag my mouse across the form to select the text. I have to click inside the TextBox and then I can only select the data that is inside that specific field. I just want to be able to click and drag my mouse over whatever textbox is in my area of selection.
have you "set its BorderStyle to none and set the background color to the color of your form. Also don't forget to set the readonly property to false"
from http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/5ac4267d-2642-4d05-ae84-1562bf16d068/

C# Gray out a control and draw another on it

I´m using WinForms. I want to make a little class, which modifys controls to show it´s working.
I want to draw an overlay over for example a button. It should be a half-transparent gray.
After that i want to draw a ProgressBar on over it (in the center). Similar to This, except using a progress bar.
How can i realize this? I don´t want to set the position of the progressbar, just drawing it on the other one.
How could i do this?
Thanks :)
I have done something similar before.
You need to use Button.DrawToBitmap(Bitmap, Rectangle) to get the image of the button. Then make the Bitmap grayscale (there are multiple algorithms available for this; I have used the last one successfully although probably not originally from this site).
Now, I did this with an entire form instead of a button, but I disabled the form, and then covered the entire form with an image of itself, altered and then covered it with the progress bar (itself in a panel with other controls).
You could just as easily disable the button, cover it with a panel containing the image and the progress bar on top of it.

Recreate Chrome's "status text" functionality with WebBrowser

I am trying to recreate Chrome's method of displaying the "status text" of the web page with a WebBrowser control.
These are two methods I am trying to recreate:
Displays the text in a box in the bottom right (or left depending on cursor position) corner
Displays URL of hyperlinks when hovered over
My method:
As of now I have thought of using a ToolTip control and displaying the text within that ToolTip using the WebBrowser.StatusTextChanged event. Obviously this is a somewhat crude way to go about doing this.
So that leads me to two questions:
1: Using my current method, how could I set the position of the ToolTip to appear in the bottom-left corner of the WebBrowser control. (Note I'm using .NET 2.0)
2: What would be a more efficient way of doing this besides the method I've came up with so far?
I think you can simply use a Label and put it over your WebBrowser control, somewhere at the bottom. You'll have to take into consideration the webbrowser's horizontal scroll bar (there is a WebBrowser.ScrollBarsEnabled property and then you can obtain the size of the scrollbar via SystemInformation.HorizontalScrollBarHeight and positin the label so that it doesn't overlap the scrollbar).
I don't think that using ToolTips is a good idea because they have some limitations (they dissapear after a certain (system-defined) amount of time, they are always on top).

Categories

Resources