Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Few newbie questions on WinForms
Message
From
07/03/2008 10:36:21
 
General information
Forum:
ASP.NET
Category:
Forms
Environment versions
OS:
Windows XP
Miscellaneous
Thread ID:
01299299
Message ID:
01299708
Views:
10
This message has been marked as the solution to the initial question of the thread.
Naomi,

I notice that no one has replied to this post. Possibly because you ask 3 totally un-related questions in one post. You might make it easier for everyone, yourself included, to have only question per thread.

>1) I don't see a Tooltip property for the textbox. My textbox may not hold the whole value, so my question is - what should I do to make a tooltip text to show the whole value in the textbox in cases when the length of it is not enough?

In the your TextBox sub-class (you *are* sub-classing controls, right?), you can add a ToolTip:
        protected ToolTip oToolTip;

	public MyTextBox()
        {
	    this.MouseEnter += new EventHandler(MouseEnterHandler);
            this.oToolTip = new ToolTip();
        }
        protected virtual void MouseEnterHandler(object sender, System.EventArgs e)
        {
            this.oToolTip.SetToolTip(this, this.Text);
        }
>2) I don't really like the MS DatePicker. I want a date textbox and a little button to show the calendar and pick the date. What would you suggest me to use here?

Nobody likes the MS date controls. We created one almost 6 years ago to overcome the deficiencies of the MS controls (a date text box, a calendar button and a time text box). I cannot reproduce it here, it's long and involved and complex, plus it's company property (they probably wouldn't like it). But a Google search might turn up something useful.

>3) I have a texbox to type the name of the file to save the results into. I'm thinking of using SaveDialog, but I also want to be able to plainly type in the textbox without any dialogs. I'm thinking what would be a good approach here? Add this dialog invocation in the GotFocus of the textbox? What do you think?

Not a good idea in the GotFocus ... probably just a button next to the TextBox (you know, one with an ellipsis ...)

~~Bonnie



>
>UPDATE. Wow, got an error that causes the VS to shut down.
>
>I had the following code in the GotFocus of the textbox:
>
>Private Sub txtOutput_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtOutput.GotFocus
>        Dim result As DialogResult = Me.SaveFileDialog1.ShowDialog()
>        If result = DialogResult.OK Then
>            Me.txtOutput.Text = SaveFileDialog1.FileName
>        End If
>    End Sub
>
>
>I guess I should try something different here.
>Thanks a lot in advance.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform