|
Have you thought about just using a PictureBox control as your button? Or are you wanting the "effect" of a "downward click" when the mouse is clicked?
|
|
|
|
|
Yes. I need "downward click" "effect". When I do button.FlatStyle = FlatStyle.Standard, everything works fine but the look and feel of the button is like windows 2000 button.
|
|
|
|
|
Then I'm going to go with making a custom control that has the style + effect + picture.
|
|
|
|
|
Thanks for your time. Please see the next reply for an article on the same.
|
|
|
|
|
Heh, exactly what I posted except I didn't have an example...
|
|
|
|
|
Yes you did. Thats why I pointed you to the article. It might be useful for you also.
Anyway, thanks for your help.
|
|
|
|
|
Ohhh, ok.. well thanks for the info then and I'm happy to help (even a little)
|
|
|
|
|
No. You have to implement this yourself. Check out this link.
http://www.codeproject.com/cs/miscctrl/MgXpImageButton.asp
I implemented something similar in a project.
I hope this helps.
Human beings were not meant to sit in little cubicles staring at computer screens all day, filling out useless forms and listening to eight different bosses drone on about about mission statements. -- Peter Gibbons
|
|
|
|
|
Bingo.
This is exactly what I was looking for.
Thanks.
|
|
|
|
|
Is it possible to bind the text of a label to a variable so that if the variable changes, the displayed text on the label changes?
|
|
|
|
|
Sort of... one easy way to do this is to create a get/set for the variable and in the SET just change the text of the label as well:
<code>
private string myVariable;
public string MyVariable
{
get
{
return this.myVariable;
}
set
{
this.myVariable = value;
this.Label1.Text = value;
}
}
</code>
Now when you do something like: MyVariable = "Blah";
it will run through the "set" portion of the code and change the label as well as the internal private variable
-- modified at 14:57 Monday 10th October, 2005
|
|
|
|
|
[EDIT] Forget it, I don't think it will work the way you want.[/EDIT]
Does this work?
class MainForm : Form
{
string labelText = "Blah";
public MainForm()
{
InitializeComponent();
label1.DataBindings.Add("Text", this, "labelText");
}
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
-- modified at 21:27 Monday 10th October, 2005
|
|
|
|
|
I am working on this project in which I create dynamic dropdown lists with C# ASP.NET and I want to save each dropdownlist so that I can see what value the user selected when they click the submit button. The only thing is when a postback occurs, everything is reset. I tried saving the dropdowns in Session variables but that does not seem to work. If anyone can help, I would really appreciate that. Thanks
Sincerely,
The Major Rager
|
|
|
|
|
Typically this means you're not setting up your drop down lists in a !IsPostback block.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
This is usually (in my experience) done in the Page_Load event. Just use an if(!Page.IsPostback) block like stated above.
|
|
|
|
|
Is it possible to add an Underlined letter style shortcut to the buttons of a MessageBox dialog without wrting my own class to do it.
|
|
|
|
|
No
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I didn't think so, but my manager asked me to check.
|
|
|
|
|
Tell him you spent longer checking than it takes to write such a simple dialog, and that makes him an idiot.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
*grin*
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
It'd take me longer than this posting because I don't know how to do the automagic width setting based on the message string. It's an issue for complying with client provided UI standards, although I suspect we'll just br adding it to the waiver list.
|
|
|
|
|
Graphics.MeasureString
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Where/how should I make the call. I tried doing it in the set method for the relevant string, but intelisence won't show the constructor for a Graphics object, and I can't find where to find an existing one for the form.
|
|
|
|
|
Basically you need to create a graphics object for the control, use it to measure the string, and use that to resize the box, probably in the constructor, given that you probably set the string before calling showDialog
Christian Graus - Microsoft MVP - C++
|
|
|
|