Solved

Updown in a textbox

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
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…

863 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

26 Experts available now in Live!

Get 1:1 Help Now