Solved

Updown in a textbox

Posted on 1998-10-14
3
206 Views
Last Modified: 2010-04-30
Anybody know how to place a updown control inside a textbox?
Thanks
0
Comment
Question by:Calibus
  • 2
3 Comments
 
LVL 4

Expert Comment

by:mcix
ID: 1439958
What do you mean by place it inside a TextBox?
0
 
LVL 4

Accepted Solution

by:
mcix earned 100 total points
ID: 1439959
This would actually put it "inside" a TextBox:

Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Sub Form_Load()
    Dim mlngAPIResult As Long
   
    mlngAPIResult = SetParent(UpDown1.hWnd, Text1.hWnd)
    UpDown1.Left = Text1.Width - UpDown1.Width - 50
    UpDown1.Top = 0
End Sub

0
 
LVL 1

Expert Comment

by:mr_krishna
ID: 1439960
Place one textbox control and updown control in a form.
Set the following buddy control properties.
Goto custom properties. Here buddy tab page. In this page
set Buddy control property to "text1" and buddy property to "text".
When you set the buddy control property to text1 it automatically aligned the text box. This look likes spin control.
If you want to change the Min, Max, value properties of buddy control whatever you want.
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

810 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