473,405 Members | 2,210 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

How to open a DBCombo with API calls?

Hi

In my prgragm i use an API call to open the combobox when it get the
focus.

The code i use is this
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA"
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam
As Any) As Long

Public Const CB_SHOWDROPDOWN = &H14F
Public Const CB_GETDROPPEDSTATE = &H157

Public Sub OpenCloseCombo(chwnd As Long)
Dim rc As Long
rc = SendMessage(chwnd, CB_GETDROPPEDSTATE, 0, 0)
If rc = 0 Then
SendMessage chwnd, CB_SHOWDROPDOWN, True, 0
Else
SendMessage chwnd, CB_SHOWDROPDOWN, False, 0
End If
End Sub


But this does not work with the DBCombo.

Anyone an idea how to do that?

Peter
Nov 21 '05 #1
3 2981
Peter,

First I am curious, what is the reason that you want an unmanaged control in
your program?

Secondly when you really want it you can try it by changing the longs for
integer
(That is shifted in VBNet from VB6)

I hope this helps?

Cor
Nov 21 '05 #2
Sorry

Wrong group.
Peter

On Wed, 12 Jan 2005 12:08:16 +0100, Peter van der Veen <me@home.nl>
wrote:
Hi

In my prgragm i use an API call to open the combobox when it get the
focus.

The code i use is this
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA"
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam
As Any) As Long

Public Const CB_SHOWDROPDOWN = &H14F
Public Const CB_GETDROPPEDSTATE = &H157

Public Sub OpenCloseCombo(chwnd As Long)
Dim rc As Long
rc = SendMessage(chwnd, CB_GETDROPPEDSTATE, 0, 0)
If rc = 0 Then
SendMessage chwnd, CB_SHOWDROPDOWN, True, 0
Else
SendMessage chwnd, CB_SHOWDROPDOWN, False, 0
End If
End Sub


But this does not work with the DBCombo.

Anyone an idea how to do that?

Peter


Nov 21 '05 #3
"Peter van der Veen" <me@home.nl> schrieb:
But this does not work with the DBCombo.

Anyone an idea how to do that?


For VB.NET: Set the combobox's 'DroppedDown' property to 'True'.

For VB6: Consider posting to one of the groups in the microsoft.public.vb.*
hiearchy, for example microsoft.public.vb.controls.databound or similar.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

46
by: Steve | last post by:
Access97 Database The database is split into a frontend and backend and not connected to any other database. The database has an unbound report with 15 subreports. Some of the subreports include...
2
by: David | last post by:
Hello, I have an application that has been running for years and had little problem with it. We've been retesting the latest code under Windows 2003 and found a surprise. There is a certain...
13
by: Blue | last post by:
Hi , Can any one please let me explain me the diffrences between "open"/ "fopen" or "read"/"fread" or "write/fwrite". I know that "open" /"read" / "write" are system calls and "fopen"...
1
by: nkechifesie | last post by:
I need to lock the DbCombo text box so no one can enter anything but they can use the Drop down list. How do I go about this? I tried making the Locked property True but it disabled the Drop down...
0
by: nmn | last post by:
thank you in advance.. i am trying to retrive data to my txt fields from access tables by using dbcombo i am using DATA1 for the datasource and "car" for the table. i have no problem in...
1
by: needvb | last post by:
hi all im searching 4 a code 4 dbcombo
1
by: nmn | last post by:
i am trying to change the data on screen by dbcombo ... the code is below Private Sub DBCombo1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single) Dim recSource As String ...
1
by: meijin | last post by:
can you please help me with the dbcombo? i can't connect my database/data to the listfield and it's rowsource.
1
Kabyr
by: Kabyr | last post by:
Please, can someone tell me how I can use a DBCombo with a MSSQL database? I have a database, with 3 tables, Country, States, Persons. Country has CountryID (Primry), Name. State has StateID...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.