Click here to Skip to main content
15,913,939 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Deleting desktop shortcut while not administrator Pin
clemb21-Jul-06 4:51
clemb21-Jul-06 4:51 
QuestionGetting the Parent Window Handle Pin
HakunaMatada10-Jul-06 3:53
HakunaMatada10-Jul-06 3:53 
AnswerRe: Getting the Parent Window Handle Pin
Sarath C10-Jul-06 4:15
Sarath C10-Jul-06 4:15 
GeneralRe: Getting the Parent Window Handle Pin
HakunaMatada10-Jul-06 17:20
HakunaMatada10-Jul-06 17:20 
AnswerRe: Getting the Parent Window Handle Pin
Abhi Lahare10-Jul-06 4:15
Abhi Lahare10-Jul-06 4:15 
AnswerRe: Getting the Parent Window Handle Pin
FarPointer10-Jul-06 4:18
FarPointer10-Jul-06 4:18 
AnswerRe: Getting the Parent Window Handle Pin
ThatsAlok10-Jul-06 19:20
ThatsAlok10-Jul-06 19:20 
Questionlist control Pin
jokefake10-Jul-06 3:49
jokefake10-Jul-06 3:49 
hello
I am trying to make a list control , so that it will display both name and
number when i enter them.

1) how do i delete an item from the list control
ie
void CSpeedDial::OnSpeedDel()
{
//
}

2)how do i move an item up or down in the list contol using "up buttom" and
"down buttom" i have created
ie
void CSpeedDial::OnSpeedUp()
{
}

and
void CSpeedDial::OnSpeedDown()
{
}

3)how do i make the "add buttom" disable when i have 8 items in the list
control.


this is what I have done so far:




BOOL CSpeedDial::OnInitDialog()
{
CDialog::OnInitDialog();

CRect rect;
m_speedList.GetClientRect(&rect);
m_speedList.InsertColumn(0,_T("Name"),LVCFMT_LEFT,rect.Width()/2,0);
m_speedList.InsertColumn(1,_T("Number"),LVCFMT_LEFT,rect.Width()/2,0);

m_speedList.SetImageList(&imList, LVSIL_SMALL);
for (int i=0;i< m_speedArray.GetSize();i++)
{
m_speedList.InsertItem(i,m_speedArray.GetAt(i));
}

// TODO: Add extra initialization here

return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}

void CSpeedDial::OnSpeedAdd()
{
// TODO: Add your control notification handler code here
CString AliasName,AliasNumber;
m_speedName.GetWindowText(AliasName);
m_speedNumber.GetWindowText(AliasNumber);
AliasName.TrimRight();
AliasName.TrimLeft();
AliasNumber.TrimLeft();
AliasNumber.TrimRight();
if(AliasName.FindOneOf("=|")>=0) return;

int nIndex = m_speedList.InsertItem(m_speedList.GetItemCount(),AliasName);
m_speedList.SetItemText(nIndex,1,AliasNumber);

m_speedName.SetWindowText(_T(""));
m_speedNumber.SetWindowText(_T(""));

}


thanks for you help
AnswerRe: list control Pin
Sarath C10-Jul-06 4:17
Sarath C10-Jul-06 4:17 
AnswerRe: list control Pin
David Crow10-Jul-06 4:19
David Crow10-Jul-06 4:19 
GeneralRe: list control Pin
jokefake10-Jul-06 5:46
jokefake10-Jul-06 5:46 
GeneralRe: list control Pin
David Crow10-Jul-06 6:11
David Crow10-Jul-06 6:11 
GeneralRe: list control Pin
jokefake10-Jul-06 6:39
jokefake10-Jul-06 6:39 
QuestionRe: list control Pin
David Crow10-Jul-06 6:41
David Crow10-Jul-06 6:41 
AnswerRe: list control Pin
jokefake10-Jul-06 6:48
jokefake10-Jul-06 6:48 
GeneralRe: list control Pin
David Crow10-Jul-06 7:31
David Crow10-Jul-06 7:31 
GeneralRe: list control Pin
jokefake11-Jul-06 1:57
jokefake11-Jul-06 1:57 
GeneralRe: list control Pin
David Crow11-Jul-06 2:07
David Crow11-Jul-06 2:07 
GeneralRe: list control Pin
jokefake11-Jul-06 2:57
jokefake11-Jul-06 2:57 
GeneralRe: list control Pin
David Crow11-Jul-06 4:52
David Crow11-Jul-06 4:52 
QuestionRe: list control Pin
jokefake11-Jul-06 5:29
jokefake11-Jul-06 5:29 
AnswerRe: list control Pin
David Crow11-Jul-06 5:39
David Crow11-Jul-06 5:39 
GeneralRe: list control Pin
jokefake11-Jul-06 6:01
jokefake11-Jul-06 6:01 
GeneralRe: list control Pin
David Crow11-Jul-06 6:19
David Crow11-Jul-06 6:19 
QuestionRe: list control Pin
jokefake11-Jul-06 7:02
jokefake11-Jul-06 7:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.