|
Is the ocx registered on the client machines?
|
|
|
|
|
how to change tab text color in tab control.give samples plz.
|
|
|
|
|
you need to make an owner draw tab control
http://www.codeproject.com/tabctrl/customtab.asp
if u didnt understand the code let me know
|
|
|
|
|
i want to give color to tab caption for each tab in that control.like,if a tab control have two tabs like tab1 and tab2.am want to change tab1 & tab2 to colored one.how to do this.
|
|
|
|
|
see this code
void CEnTabCtrl::DrawItem(LPDRAWITEMSTRUCT lpdis)
{
TC_ITEM tci;
CDC* pDC = CDC::FromHandle(lpdis->hDC);
HIMAGELIST hilTabs = (HIMAGELIST)TabCtrl_GetImageList(GetSafeHwnd());
BOOL bSelected = (lpdis->itemID == (UINT)GetCurSel());
BOOL bColor = (s_dwCustomLook & ETC_COLOR);
CRect rItem(lpdis->rcItem);
if (bSelected)
rItem.bottom -= 1;
else
rItem.bottom += 2;
// tab
// blend from back color to COLOR_3DFACE if 16 bit mode or better
COLORREF crFrom = GetTabColor(bSelected);
if (s_dwCustomLook & ETC_GRADIENT && pDC->GetDeviceCaps(BITSPIXEL) >= 16)
{
COLORREF crTo = bSelected ? ::GetSysColor(COLOR_3DFACE) : Darker(!bColor || m_crBack == -1 ? ::GetSysColor(COLOR_3DFACE) : m_crBack, 0.7f);
int nROrg = GetRValue(crFrom);
int nGOrg = GetGValue(crFrom);
int nBOrg = GetBValue(crFrom);
int nRDiff = GetRValue(crTo) - nROrg;
int nGDiff = GetGValue(crTo) - nGOrg;
int nBDiff = GetBValue(crTo) - nBOrg;
int nHeight = rItem.Height();
for (int nLine = 0; nLine < nHeight; nLine += 2)
{
int nRed = nROrg + (nLine * nRDiff) / nHeight;
int nGreen = nGOrg + (nLine * nGDiff) / nHeight;
int nBlue = nBOrg + (nLine * nBDiff) / nHeight;
pDC->FillSolidRect(CRect(rItem.left, rItem.top + nLine, rItem.right, rItem.top + nLine + 2),
RGB(nRed, nGreen, nBlue));
}
}
else // simple solid fill
pDC->FillSolidRect(rItem, crFrom);
// text & icon
rItem.left += PADDING;
rItem.top += PADDING + (bSelected ? 1 : 0);
pDC->SetBkMode(TRANSPARENT);
CString sTemp;
tci.mask = TCIF_TEXT | TCIF_IMAGE;
tci.pszText = sTemp.GetBuffer(100);
tci.cchTextMax = 99;
GetItem(lpdis->itemID, &tci);
sTemp.ReleaseBuffer();
// icon
if (hilTabs)
{
ImageList_Draw(hilTabs, tci.iImage, *pDC, rItem.left, rItem.top, ILD_TRANSPARENT);
rItem.left += 16 + PADDING;
}
// text
rItem.right -= PADDING;
FormatText(sTemp, pDC, rItem.Width());
COLORREF col;
col=RGB(255,0,0);
pDC->SetTextColor(col);
pDC->DrawText(sTemp, rItem, DT_NOPREFIX | DT_CENTER);
}
|
|
|
|
|
Hi,
I am designing an editor in C#. for example in searching for a text(Find)
when the searching text is found it should be highlighted.One more think,
i want to implement line number functionality in my editor.i dont know how
to do .
Please if any one knows help me.
With Thanks
Sakthi
|
|
|
|
|
|
SakthiSurya wrote: I am designing an editor in C#.
Wouldn't you think your question would be better suited here?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Only a thought: can you use a predesigned editor? you can always attach the scintilla DLL inside your project and then you would have a lot of power without almost effort inside your app.
Hope this helps.
|
|
|
|
|
My Listview control is working fine but it add item at first position in the listview(other shift below)I want it to add the item at last.
fot that what should I do?
Amit
|
|
|
|
|
You need to provide index of item to add. Can you show code you are using ?
|
|
|
|
|
Sure master!
but if i use the listview count and then according the last count i add one in the count and then try to put in the listview is it ok ?
Amit
|
|
|
|
|
You can do something like this as per your needs...
LV_ITEM lvitem;
int nIndex = -1;
lvitem.mask = LVIF_TEXT;
lvitem.iItem = i;
lvitem.pszText = "";
lvitem.iSubItem = 0;
lvitem.state = 0;
nIndex=m_ListCtrl .InsertItem(&lvitem);
i++;
CString str;
str.Format("%d",i);
m_ListCtrl.SetItemText (nIndex,0,str);
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
amitmistry_petlad wrote: ...but it add item at first position in the listview...
Only because you have 0 hardcoded as the item number.
Are you adding items in a for /while loop?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
hi
The number that u have used for inserting in the listview might be overlapped.
Check it.
Better test by testing inserting 10 items as
for(int iListIndex=0; i<10; i++)
{
//code to insert in listview;
}
VIBIN
"Fool's run away,where angle's fear to tread"
|
|
|
|
|
|
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
and here enters the blast
|
|
|
|
|
Some idiot did not like it but
|
|
|
|
|
brahmma wrote: Some idiot did not like it
Well, you got my 5!
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
|
|
|
|
|
Thank you very much Wes Aday. I am very glad that you liked it.
|
|
|
|
|
Hello comunity,
does any one hear something about this func., can anyone say me where do learn about this search function, how to use and something about this!?
Is that something what we can use in c++?
thanks
break;
|
|
|
|
|
break; wrote: does any one hear something about this func
No.
I never come across this function. Where do you heard it ?
|
|
|
|
|
Is it a Matlab thing? What are you wanting to do?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|