Solved

How to set the TextBox behavoir while scrolling

Posted on 2004-09-03
7
176 Views
Last Modified: 2010-05-02
hello experts,
i have a usercontrol that i am creating.  it consists of a TextBox and a CommandButton.  the button is embedde/on top of and at the end of the TextBox.  the problem is when text is entered it disappears under the button.  when entering text the control should allow text to be entered like normal until it hits the left border of the button at which point all text should the be entered as if the right border of the TextBox had been reached.  in addition if the user were to hit the end key the control should scroll to the very last character which will be displayed at the left border of the button.  if i could i would put the button on the outside of the TextBox and not have any problems but i have to adhere to a visual style for this control.  any help is greatly appreciated.
dennis
0
Comment
Question by:superbeast23
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 19

Expert Comment

by:Shauli
ID: 11976736
Do you want the command button to be with a fixed height on the upper right corner of the textbox, regardless of the height of the textbox, or do you want it to stretch up and down to the height of the textbox?

S
0
 

Author Comment

by:superbeast23
ID: 11977427
i want it to stretch as one unit like a combo box when the font size is changed.
0
 

Author Comment

by:superbeast23
ID: 11977443
i will be leaving for labor day weekend and will check responses after labor day just so you know.
Dennis
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 14

Accepted Solution

by:
Matti earned 200 total points
ID: 11977662
Put the textbox and command button inside of a picturebox.
Set textbox bordersytle None and BackColor of the picture box Window Background.
0
 
LVL 13

Assisted Solution

by:Michael_D
Michael_D earned 50 total points
ID: 11977721
i think you should "fake" your textbox.
put label on your UC , make background color white (or window background)
over the label put textox with borderstyle set to 0 (the height of textbox should be a bit smaller then label's so you can see label's border) . on the right from texbox put your button.
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 11980434
I'm thinking along the lines of Matti.  Why does the command button have to be on top of the textbox?  You can create the border you want and still place the command button adjacent to the textbox on its right edge w/o going through all of this extra trouble in maintaining this common behavior.
0
 
LVL 13

Expert Comment

by:Michael_D
ID: 11982698
Good question, AzraSound. But if superbeast23 wants so why not to do.
Matti, Picturebox is heavy object becouse of its functionality. and there is no need of it. that the reason I suggest use of label.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month4 days, 23 hours left to enroll

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question