|
hi,
I have a msflexgrid with 2 columns and 25 rows(all with data in it) in my dialog.i'm also having a edit box in the same dialog above the flex grid.now wat i want is..if i type a name or a letter in the edit box the mouse pointer should go to that row that contains the name.
for example if i hav 2 colums(name and rollno)in msflexgrid
if i type "A" in the edit box,thn the mouse cursor should go to the row where that name column contains first letter as "A".Is there any function for getting the mouse pointer to our flexgrid?
Anybody please help mi in this regard.
Thanks in advance,
Saravana..
|
|
|
|
|
iam not sure, weather you can take your mouse pointer or current focus to the required cell, but you can select the required cell and also set its color.
if you are stuck up in searching the item, then,
you have to initialise the loop and search every item, and see if any letter has the starting digit A (for example).
any more guidance required?
you are welcome.
good luck.
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
How create MFC toolbar with png icons ?
|
|
|
|
|
There is no way other than loading the png s and then convert them to a (device-dependent) CBitmap, I fear.
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
Do you want to make a toolbar with image?
|
|
|
|
|
I want make toolbar with png image (with alpha transparency) on button's.
|
|
|
|
|
You can read png files and then convert to CBitmap for use on the toolbars.
|
|
|
|
|
_Tiranox_ wrote: toolbar with png image (with alpha transparency)
Thats probably not possible. At least not out of the box.
Here[^] are some buttons allowing transparency.
And here[^] is an example of a toolbar with background-bitmap.
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
|
Hello Friends,
I am using WIN32 Dialog based Application. And in that I am using combo box. But not able to add the string in the combo box.
the Code I use to set the text in dialog box in as follows
case WM_INITDIALOG:
TCHAR *ValueName = new TCHAR[20];
wcscpy(ValueName,L"Gaurang ");
hCombo = GetDlgItem(hWndDlg,IDC_COMBO1);
SendDlgItemMessage(hWndDlg,IDC_COMBO1,(UINT)CB_ADDSTRING,(WPARAM)0,(LPARAM)L"Gaurang");
dError = GetLastError();
LRESULT lr = SendMessage(hCombo,(UINT)CB_ADDSTRING,(WPARAM)0,(LPARAM)L"ValueName");
dError = GetLastError();
break;
When I use the above line of code to set the Text in combo box it gives me the 1460 error code which says "This operation returned because the timeout period expired"
-- modified at 6:55 Monday 29th October, 2007
|
|
|
|
|
Are you sure that combobox is created with the same ID?
Also can you do this from anyother event than WM_INITDIALOG? I mean any WM_LBUTTONDOWN?
- NS -
|
|
|
|
|
Hi,
When I use the above code in some Button even then I am getting Error code as 5.
I.e.
case WM_COMMAND:
if (LOWORD(wParam) == IDOK)
{
SendMessage(GetDlgItem(hWndDlg,IDC_COMBO1),(UINT)CB_ADDSTRING,(WPARAM)0,(LPARAM)L"ValueName");
dError = GetLastError(); //dError = 5; which mean Access denied
}
|
|
|
|
|
I have tried it.
It is working fine...
What is the return value of the SendMessage?
- NS -
|
|
|
|
|
I am using this code in Modeless Dialog Box. Can it be the source of problem ? This is what I am getting.
lr= SendMessage(hCombo,(UINT)CB_ADDSTRING,(WPARAM)0,(LPARAM)ValueName);
dError = GetLastError();
lr= SendMessage(hCombo,(UINT)CB_ADDSTRING,(WPARAM)0,(LPARAM)ValueName);
dError = GetLastError();
lr= SendMessage(hCombo,(UINT)CB_ADDSTRING,(WPARAM)0,(LPARAM)ValueName);
dError = GetLastError();
lr= SendMessage(hCombo,(UINT)CB_GETCOUNT,(WPARAM)0,(LPARAM)0);
dError = GetLastError();
|
|
|
|
|
I got the problem...
CB_ADDSTRING has no effect on last error.
Try like this and you will get the answer...
SetLastError( 10 );
SendDlgItemMessage( hDlg, IDC_COMBO1, CB_ADDSTRING, 0, (LPARAM)L"Apple" );
- NS -
|
|
|
|
|
Thnx Again. But its NOT working. I tried you code in WM_INITDIALOG and in Button even also. But its not showing anything in the combo box.
|
|
|
|
|
sorry for my post. It was happpening due to the silly mistake. the hight of the comobox was too small to show the charcters in it. I just take the new combo box with greater hight and problem solved.
Thnx a lot for your help
|
|
|
|
|
OK... kindly ignore my next solution... ha ha...
- NS -
|
|
|
|
|
Wow so your problem wasnt combobbox and your answer was MoveWindow
|
|
|
|
|
But the return value is the indication of success and again the count is correct as per your previous post... What kind of combobox is that? Can you check your code by doing as follows?
1. Add some items to combobox and through the resource editor
2. Comment out the dynamic item adding (CB_ADDSTRING) codes
3. Run the application and test it
- NS -
|
|
|
|
|
CB_ADDSTRING returns the index of the item added, or CB_ERR ( = -1) if an error occurs, CB_ERRSPACE if insufficient space available. You add 3 items of the same value, each time the return value is 0, this is totally consistent with a combobox that has the CBS_SORT style. Furthermore the CB_GETCOUNT return value is 3 indicating that 3 items were infact added. Also there is no indication in the documentation of CB_ADDSTRING that it calls SetLastError() when an error occurs.
|
|
|
|
|
U can add a string to a combo box using
CString string1;
m_combobox.AddString(String1);
here m_combobox is the member variable of the combo box.
Regards..
Saravana..
|
|
|
|
|
Provided you're usign MFC , my dear (the OP uses Win32 API )...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Thnx but I am using WIN32 based Dialog Box.
|
|
|
|
|
Your code is working for me how did you make combobox can you show that code?
|
|
|
|