|
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++
|
|
|
|
|
My problem is that even though I've got system.Drawing added to my using block, intelisence isn't showing what parameters the graphics constructor takes, and for some reason I'm not finding them among the classes methods in the help either.
|
|
|
|
|
There is no constructor, only static FromXXX methods. FromHWD is probably what you need.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks. I've never done anything with the Graphics namespace before, and my experiances trying to do similar in MFC were primarily headbanging sesions.
|
|
|
|
|
|
CreateGraphics() is e mthod available from the Control class. So writing myControl.CreateGraphics whill create the appropriate Graphics object for you. Another hint: Dont forget disposing it when you don't need it anymore:
using (Graphics g = myControl.CreateGraphics()) {
}
|
|
|
|
|
I am new to C# and am doing a project using winforms.
Right now I have all individual forms (say 12 forms) for carrying out each user functionalities with proper navigation. Every thing works well. But now I want create a master form and keep all the 12 form as child forms. How do I do it.
Also even after I close the project I could still see my .exe process still running in the task manager. how do I solve this.
Thanks in advance.
|
|
|
|