|
CAN SOMEBODY HELP ME TO MOVE TEXT REGULARLY ON DIALOG BOX
Please mail me
|
|
|
|
|
Use a timer and whenever it fires, move the text a little bit (you'll need to keep track of its old position).
Some tips for your future posts:
- don't SHOUT, it is considered rude
- when asking a question, do it in a way that it is understandable for everybody (so, explain the problem with sufficient details).
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
hey, you will have to speak correctly. this is a board read by many people over the world, so speak english plainly (not SMS like).
and DON'T SHOUT
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
CAN SOMEBODY HELP ME TO MOVE TEXT REGULARLY ON DIALOG BOX
I DONT FIND SOLUTION TO MY PROBLEM
Please mail me
|
|
|
|
|
|
|
|
IDONT ASK IT FRM U THEN WHY R U BEHAVE LIKE THIS
Please mail me
|
|
|
|
|
unless you don't behave correctly yourself on the forum, i wont give you fresh air to breath
have you even read THIS[^]
points 2, 6, 8 and 11 apply perfectly to you
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
WAT I DO WITH
I DONT UNDERSTAND THE ANS SO IASK AGAIN AND AGAIN IF U DONT HAV THE ANS THEN WHY YOU INTERRUPT AND U SAY MY behave IS NOT GOOD BUT ABOUT YOU
AND IF YOU DONT HAV THE ANS THEN ITS OK WHY R U BEHAVING LIKE LOOSER
Please mail me
|
|
|
|
|
man, i KNOW the answer, but i will definitely keep it for me as long as you insult me and everybody here.
you are here since only 2 weeks, and you allow your self to insult CP seniors. F*CK !!
you don't even speak a correct english and you want us to guess your needs ?
moreover, i told you not to speak with SMS style, but no way, you keep doing it !
and now, you SHOUT to my face because i tell you nicely what's wrong with your behaviour ?
man, do you act like this in real life ? i hope not ! so why because you hide your butt behind a computer you take the right to hurt people ???? DOUBLE F*CK !!!
now, continue like this, and i'll continue to fight against you, because i respect people who respect me. no rest for the ones who use me to do the job they are too lazy to do themself
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
Beleive me, tox has got the answer, big time...
|
|
|
|
|
then could you tell me the answer plz but give me some example
because i try the previous one which doesnot solve my problem
i again repeat my problem
i have dialog box on which i write "hell0" on static control now i want that when this dialog box open this text starts moving not disappear from left to right and it should be shown on dialog box even when it move
Please mail me
|
|
|
|
|
OK, if you are calm now, then I can give it a try:
You have got the solution in the early responses of this thread (from _AnShUmAn_ and , but I will try to explain the principle further:
In order to move the static window, you must use a Windows timer.
A timer works this way:
You set it with a call to SetTimer().
When the timer expires, your OnTimer function will be called.
In your OnTimer function, call MoveWindow() or SetWindowPos() to move the static window.
(Use the function KillTimer to stop the timer).
And that's all.
I suggest you to start with getting familiar to how Windows timers work. Then put useful code in the OnTimer function.
When you start with using MoveWindow() or SetWindowPos(), then you must find out the boundries of the main window and make sure your static window remains within the main window.
Kakan
|
|
|
|
|
i declare this code in OnInitDialog function:
CString m_t2=SetTimer(4, 2000, 0);
m_t2= KillTimer(5000);
and then i use
void CAfter::OnTimer(UINT nIDEvent)
{
GetDlgItem(IDC_MOVING_TEXT)->MoveWindow(10,20,50,40,TRUE);
CDialog::OnTimer(nIDEvent);
}
where CAfter is my class name
but not work
please tell me
Please mail me
|
|
|
|
|
yogendra kaushik wrote: CString m_t2=SetTimer(4, 2000, 0);
m_t2= KillTimer(5000);
What is this? SetTimer() does not return a CString object. A timer having an id of 5000 has not been created so why try and kill it?
yogendra kaushik wrote: GetDlgItem(IDC_MOVING_TEXT)->MoveWindow(10,20,50,40,TRUE);
How do you propose this to move a window when the coordinates are unchanging?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Try this out:
Declare x and y in you dialog class .h file
If your dialog class name is Cmain_dlg and the name of the .h file is main_dlg.h, then goto main_dlg.h and declare x and y.
int x;
int y;
Go to your main_dlg.cpp file and call the WM_INITDIALG function from the class wizard.
void Cmain_dlg::OnInitDialog()
{
CDialog::OnInitDialog();
SetTimer(1, 100, NULL);
x=0,y=0;
}
Call the WM_TIMER function from the class wizard and add the following:
void Cmain_dlg::OnTimer(UINT nIDEvent)
{
x=x+2;
GetDlgItem( IDC_STATIC_Title )->SetWindowPos( 0, x, y, 0,0, SWP_NOSIZE|SWP_NOZORDER);
if (x ==200)
x=x-200;
CDialog::OnTimer(nIDEvent);
}
If this dosent help you, then nothing will!
Fortitudine Vinsinues!
|
|
|
|
|
THANKS A LOT AND SORRY TO TOX
Please mail me
|
|
|
|
|
|
yogendra kaushik wrote: because i try the previous one which doesnot solve my problem
Show the code that is not working.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
But you do want to get some help, don't you?
Outbursts like this won't make anyone more willing to help you out.
|
|
|
|
|
yogendra kaushik wrote: IDONT ASK IT FRM U THEN WHY R U BEHAVE LIKE THIS
If you behave like this you will get answer from nobody
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[ ]--
[My Current Status]
|
|
|
|
|
I create a CTabCtrl in CMainFrame::OnCreate like this:
//define in MainFrm.h
CTabCTrl m_wndTab;
//implement in MainFrm.cpp
m_wndTab.Create(TCS_TABS | TCS_FIXEDWIDTH | WS_CHILD | WS_VISIBLE,
CRect(0,0,200,20), this, 0x1006);
m_wndTab.ShowWindow(SW_SHOW);
But there is nothing i can see.
Why??
|
|
|
|
|
And I found that if I use a CReBar to hold the CTabCtrl,everything is right.
But how to do so without a CReBar object???
|
|
|
|
|
Rather than directly add a tab control to main frame, you can easily put it in a dialogbar. So, add a dialogbar template resurce and put a tab control in it. Then add a CDialogBar type member in CMainFrame class, create the dialogbar in CMainFrame::OnCreate and handle TCN_SELCHANGE notification.
Here is a sample code:
class CMainFrame : public CFrameWnd
{
CDialogBar m_dlgBar;
afx_msg void OnSelchangeTab(NMHDR* pNMHDR, LRESULT* pResult);
DECLARE_MESSAGE_MAP()
};
ON_NOTIFY(TCN_SELCHANGE, IDC_TAB1, OnSelchangeTab)
END_MESSAGE_MAP()
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
m_dlgBar.Create(this, IDD_DIALOGBAR,
CBRS_TOP|CBRS_TOOLTIPS|CBRS_FLYBY,
IDD_DIALOGBAR);
CTabCtrl* pTab = (CTabCtrl*)m_dlgBar.GetDlgItem(IDC_TAB1);
pTab->InsertItem(0, _T("RED"));
return 0;
}
void CMainFrame::OnSelchangeTab(NMHDR* pNMHDR, LRESULT* pResult)
{
}
void CMainFrame::OnSize(UINT nType, int cx, int cy)
{
CFrameWnd::OnSize(nType, cx, cy);
if( m_dlgBar.GetSafeHwnd() )
{
CTabCtrl* pTab = (CTabCtrl*)m_dlgBar.GetDlgItem(IDC_TAB1);
CRect rcDlg;
m_dlgBar.GetClientRect( rcDlg );
pTab->SetWindowPos(NULL, 0, 0, rcDlg.Width(), rcDlg.Height(),
SWP_NOZORDER );
}
}
Best regards,
Ovidiu
-- modified at 7:07 Wednesday 21st June, 2006
|
|
|
|