Solved

Updown in a textbox

Posted on 1998-10-14
3
201 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now