Slider on static text Control

hi
   i have to use a slider on a static text control  which keep a photo
.....
     i do not know how  it will happen ......
       plz some one solve my problem 
        i will appriciate

0
12/5/2006 1:24:04 PM
vc.mfc 33608 articles. 0 followers. Follow

7 Replies
1262 Views

Similar Articles

[PageSpeed] 23

I don't think there is any way to do this automatically.  You'll have to use 
the slider to figure out the position in the photo then draw the background 
on the static control in the position you want (represented by the slider). 
This article shows this happening with a color background (you'll draw your 
picture clipped appropriately instead).

http://www.codeguru.com/cpp/w-d/dislog/colors/article.php/c4985/

Tom

<nandan.mehra@gmail.com> wrote in message 
news:1165325044.816202.217320@73g2000cwn.googlegroups.com...
> hi
>   i have to use a slider on a static text control  which keep a photo
> ....
>     i do not know how  it will happen ......
>       plz some one solve my problem
>        i will appriciate
> 


0
tserface (3861)
12/5/2006 2:50:21 PM
I presume you mean a scrollbar.

What you will get are WM_HSCROLL or WM_VSCROLL messages.  

There's a topic called "Scroll Bar Controls in Win32" which might be useful, but for
reasons that do not seem to make any sense, when I install the MSDN library on my machine,
it doesn't install this article, and prompts me to install a second disk (which is
somewhere, I'm sure).  Another useful article is "About Scroll Bars".  

All that happens is you get a notification that the scrollbar has changed.  What you do
with that information is up to you.  You can scroll the image (which is probably what you
want to do) and record that you have done so by setting the scroll position.  Note that
scrollbars, when clicked, dragged, or otherwise manipulated by the user, do NOT actually
set the value in the scrollbar; you have to explicitly call SetScrollPos in your handler
to make the change "stick"	
				joe


On 5 Dec 2006 05:24:04 -0800, "nandan.mehra@gmail.com" <nandan.mehra@gmail.com> wrote:

>hi
>   i have to use a slider on a static text control  which keep a photo
>....
>     i do not know how  it will happen ......
>       plz some one solve my problem 
>        i will appriciate
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
12/5/2006 6:00:40 PM
thx tom 4 giving reply
  i have to set slider control to with my Static text control ........
     i do not know how should i set this slider to static text contol
......
          this is the code where i want to set the slider with text
control
               plz solve my problem
                              i will appriciate



void CThumbnailDlg::OnReleasedcaptureSlider(NMHDR* pNMHDR, LRESULT*
pResult)
{
int iPos = m_ctrlSlider.GetPos();
   m_ctrlSlider.SetRange(0,100); 
*pResult = 0;
}

0
12/6/2006 5:56:50 AM
I think you could just inherently know that the slider represents the 
postion in your picture and adjust to picture to match the place the slider 
indicates by painting it into the CStatic window.  I'm not sure what you are 
doing with text... Are you trying to "slide" a text string based on the 
position.  I could have misunderstood, but I thought you were trying to 
position a picture within a CStatic control window.  The article I 
referenced had information about using the slider control with a CStatic. 
You'll just have to adjust to code to work with your picture rather than the 
color variants that were used in the example.  You'll have to paint the part 
of the picture you want to display depending on the slider control position.

If you would rather use scroll bars as part of the control you could use 
Joe's example and capture the messages when the scroll bars are moved....

HTH,

Tom

<nandan.mehra@gmail.com> wrote in message 
news:1165384610.079594.88560@80g2000cwy.googlegroups.com...
> thx tom 4 giving reply
>  i have to set slider control to with my Static text control ........
>     i do not know how should i set this slider to static text contol
> .....
>          this is the code where i want to set the slider with text
> control
>               plz solve my problem
>                              i will appriciate
>
>
>
> void CThumbnailDlg::OnReleasedcaptureSlider(NMHDR* pNMHDR, LRESULT*
> pResult)
> {
> int iPos = m_ctrlSlider.GetPos();
>   m_ctrlSlider.SetRange(0,100);
> *pResult = 0;
> }
> 


0
tserface (3861)
12/6/2006 6:16:00 AM
thx tom for gvg reply
   tom i have taken a static control which keep a photo ......(picture)
     the name of control is m_staicpic
 now i want to set this Slider  with that control ....


> > void CThumbnailDlg::OnReleasedcaptureSlider(NMHDR* pNMHDR, LRESULT*
> > pResult)
> > {
> > int iPos = m_ctrlSlider.GetPos();
> >   m_ctrlSlider.SetRange(0,100);
> > *pResult = 0;
> > }
> >

0
12/6/2006 6:37:11 AM
OK.  This article shows how to scroll a bitmap and you would use sliders in 
a similar way.  You have to draw the bitmap using the coordinates you want 
based on the slider.

HTH,

Tom

<nandan.mehra@gmail.com> wrote in message 
news:1165387031.062167.297210@j44g2000cwa.googlegroups.com...
> thx tom for gvg reply
>   tom i have taken a static control which keep a photo ......(picture)
>     the name of control is m_staicpic
> now i want to set this Slider  with that control ....
>
>
>> > void CThumbnailDlg::OnReleasedcaptureSlider(NMHDR* pNMHDR, LRESULT*
>> > pResult)
>> > {
>> > int iPos = m_ctrlSlider.GetPos();
>> >   m_ctrlSlider.SetRange(0,100);
>> > *pResult = 0;
>> > }
>> >
> 


0
tserface (3861)
12/6/2006 3:45:36 PM
See below...
On 5 Dec 2006 21:56:50 -0800, "nandan.mehra@gmail.com" <nandan.mehra@gmail.com> wrote:

>thx tom 4 giving reply
>  i have to set slider control to with my Static text control ........
>     i do not know how should i set this slider to static text contol
>.....
>          this is the code where i want to set the slider with text
>control
>               plz solve my problem
>                              i will appriciate
>
>
>
>void CThumbnailDlg::OnReleasedcaptureSlider(NMHDR* pNMHDR, LRESULT*
>pResult)
>{
>int iPos = m_ctrlSlider.GetPos();
>   m_ctrlSlider.SetRange(0,100); 
***
The range should be set in the OnInitDialog, not here

Why are you worrying about capture release?  Where and how is capture set?
*****
>*pResult = 0;
>}
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
12/6/2006 6:30:41 PM
Reply:

Similar Artilces:

Text Values
Hello, Can anybody help, I'm after making a spreadsheet in Excel to record times for individuals, for example if I typed in 'early shift' with the value of 10 hours, after 'noon shift' 8 hours as well as 'late' shift at 12 hours...etc, the total values would all show in a totals cell for that person. I would appreciate any help with the above. Love, Susan Hi Susan see your response in public.Excel -- Regards Frank Kabel Frankfurt, Germany Susan wrote: > Hello, > > Can anybody help, I'm after making a spreadsheet in Excel to record > times ...

How do I change text to proper when text is already in upper?
I am working on a big Data base. The names were put in Excel, it is in all upper case. I need it in Proper. I tried to change it and I can't get it right. If anyone can help it would be great. Thanks Kate I need a step by step instructions "K" wrote: > .. The names were put in Excel, it is in all > upper case. I need it in Proper. > I tried to change it and I can't get it right. I'm not sure what you tried ? Anyway, we could try this on a spare copy Assuming names are in col A, in A2 down Put in say, B2: =TRIM(PROPER(A2)) Copy B2 down If the results are o...

text / formula help #2
cannot get the following equation to work, is it wrong? only way to get to switch TRUE to FALSE, is to flip > to <; Changing the days in A4 having no effect. =IF(TODAY()>DATE(MID(C4,2,2),MID(C4,4,2),MID(C4,6,2)-$A$4),"yes","no") details: am trying to find a number within text, to do a calculation on it. Item is as: :060120 at the left of a cell, with text following. (need to treat as a date in another cell: to See if within future range of x days) A4 has: 5 B4 has: =TODAY() C4 has: :060122 D4 has: =DATE(MID(C4,2,2),MID(C4,4,2),MID(C4,6,2)-$A$...

speaker tone control?
XP Home SP3 I don't actually use the sound very much when I'm at the computer, but listening to some online clips today I find them rather high pitched. The XP speaker controls don't seem to include a tone adjustment. Is there an add-on or alternative speaker control for tone or is this just a fixed function of this old Dell Inspiron 2600 laptop? S Spamlet wrote: > XP Home SP3 > > I don't actually use the sound very much when I'm at the computer, but > listening to some online clips today I find them rather high pitched. The > XP ...

interlinear or parallel text
I need to prepare a document in two languages, where the text would go in alternate lines. From the googling I have done, it could be called parallel corpora, or interlinear or parallel text. There seems to be a lot of research on translation software that would do it: http://research.microsoft.com/apps/pubs/default.aspx?id=75238 http://tcc.itc.it/people/forner/multilingualcorpora.html However, my case is much simpler (I think). I'll try to keep it short: I have a leaflet in English but I need to add Polish text directly below English for the people who don't speak Engl...

layering logo can't remove white box only lines and text wanted
when trying to place my logo ontop of a background I can't get rid of white box it is in... Only want black lines and text in logo to show with back ground showing through all white areas. Tried following transparent setting info. ... didn't work. Is the logo a bitmap, i.e., .jpg, .tif, bmp, .gif? If it is a .wmf, ungroup it and delete the white box or select no fill. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "sschmitz" <sschmitz@discussions.microsoft.com> wrote in message news:E4E6DA9E-117D-4226-9D0...

Determining Display Area of Tab Control in MFC
Can anyone help me understand the behavior of the following code? This code is part of an MFC application and CDialogTabCtrl is a class derived from CTabCtrl. m_arPanels is an array of pointers to CWnd objects that correspond to each tab of the tab control. The following code seems to work fine but I'm not sure why. The problem is the call to MoveWindow. The docs say that the right and bottom members of the structure specify the width and height of the window. But when I uncomment the two lines that convert the right/bottom to the width/height, I get a larger margin along the right and b...

Update a control when a new page is opened in a form
I want to make a command button visible so the user can perform an action (say, print a letter) when a certain text box is filled in. I was finally successful in doing this. However, when I open a new page in the form, I can't figure out how to make the command button invisible again -- the command button remains visible even though the text box is empty. How do I get the page (whether I am clicking forward or backward) to make the command button visible (if the text box is filled in) or make the command button invisible (if the text box is empty)? I am very new to Access. I am...

Converting a field from Yes/No to Text Box not changing in a form
Hi I am in the process of creating a form in which I realized that I had set up a field in a table to be Yes/No (1 or 0). I realized that I actually need it to read "Yes" or "No" just I converted it to a text field. But when I check my form, it doesn't reflect my change. In other words, the fields are blank whereas I wanted to see either a "Yes" or a "No". How do I fix this problem without recreating the form? Thanks in advance. Are you certain that the text box is bound to the field in the table? -- Doug Steele, Microso...

axis wrap text
Hi! When I create bar chart with relatively long lables for categories on Y (left) axis the program by default puts the label in one line. This means that sometimes half of my screen is occupied by labels (i.e. "exchange of cell phone ringtones") and the other half are the actual bars. This gets pretty annoying when I have only few categories and the labels could easily be written in 3 or even four lines. Do you have any ideas hor to force the program to write labels in "wrap text" mode? Kind regards, Sunshine P.S. Another thing that's bothering me is the de...

format text in x axis
I have category text in the x-axis that consists of information from two columns. When I format the text (rotate) only one of the two items is rotated, the other is unchanged. How can I make both rotate to the position I want? Thanks, ...

Save word doc as non-editable and place watermark over the text
Hi, 1) I'm wondering if I can save a word document as non-editable? I want to prevent others from copying my text. 2) Is it possible to place a watermark over the text? It is impossible to prevent anyone you allow to view your text from copying it. You can merely make it more difficult. Yes you can add watermarks to your document. A watermark is simply a graphical image placed behind the text. For it to be of any use, you need to save the word document as a graphical image, or series of images (SnagIt will do that) then save the resulting graphic(s) as a PDF. It will no...

Unable to set listening port on an activeX control
Hi. I have incorporated an activeX control on my application but when i set its listening port to a particular port it does not get set. When i do a netstat -ab on the command line, the port that my application listens to is some random port other than what i have set. What could be the problem? And how do i get it right? The similar application works in VB. Regards Rahul "rahulthathoo" <rahul.thathoo@gmail.com> schrieb im Newsbeitrag news:1153130542.084178.205340@b28g2000cwb.googlegroups.com... > Hi. > I have incorporated an activeX control on my application but when...

vertical text across multiple cells
How can I type vertical text across multiple cells. I need to type text from C2: downward across several cells depending on the length of the word. If I try it it wants to enlarge the size of C2: to accommodate the text. Highlight the cells across which the text should span. Then on the menu bar: Format > Cells, click the Alignment tab. Select the 'merge cells' checkbox and, if you want, use the dial to orient the text. "BThrasher" wrote: > How can I type vertical text across multiple cells. I need to type text from > C2: downward across several cells depe...

Vertical text in label
How do I enter vertical text in an label in Access? I would like the text to be read vertically instead of horizonally. S h i instead of Ship p Thanks See what Stephan Lebans has at http://www.lebans.com/verticaljustification.htm -- Good Luck BS"D "newbie35" wrote: > How do I enter vertical text in an label in Access? I would like the text to > be read vertically instead of horizonally. > S > h > i instead of Ship > p > > Thanks ...

Manipulating controls on Dlg Box before displaying, and making modal
Hi all. I'm trying to manipulate CStatic controls within a CDialog window, and diplay the results within a Modal window (in essence, I'm creating my own MessageBox). How do I make this window Modal once I've created it? My code: void CBenchmarkApp::OnImageProperties() //This window is to display image properties { LPCTSTR lpszText_Type; //pointer to constant character string lpszText_Type = "Test"; CWnd* pCWnd = AfxGetMainWnd(); //pointer to CChildView CImageProperties iprop(pCWnd); //Construct iprop object from CImageProperties class iprop.Create(IDD_Image_Properties,N...

Concatetating text fields in Access 2007
I've switched from Access 2003 to Access 2007. I have fields called CompanyName, Address, and Phone that I would like to have in seperate lines in a single textbox and display them on a report. I used the following vb code in Access 2003. Private Function strFullAddress() As String strFullAddress = CompanyName & vbNewline & Address and vbNewLine & Phone End Function The control source for the textbox is set to =strFullAddress() In Access 2003, everything worked fine. In Access 2007, I get a error message. I've tried every way I can think of to make this thing work, bu...

Date Time Picker control resizing
Hi, I have custom task form with some data fields using the Date Time Picker control. Sometimes, when I click on the drop down in the Date Time Picker to choose a date, the mini calendar becomes really big. If I get out of Outlook and try again sometimes its back to normal other times its can be very big or very small. I'm talking about the actual mini calendar when you click on the drop arrow and not the date field itself. Any help would be great. Thanks That's a known issue with the date picker control. You need code in your Item_Open event handler to size the control as ...

Outlook 2k: Plain Text
Hi, I am running O2k on W2k sp4. I thought "Plain Text" was Plain Text, but I get messages in, say, "(Plain Text) - Central European (Windows)" and/or other "European" designation and the font and/or size is different from my (default specified) "Plain Text". What are these "European" designations? Can I convert them to ordinary plain text? If so, how? My little ("edit") routine for converting html doesn't work. Thanks, Puddin' "Blues starts to rolling ... stops at my front do'. I'm gonna change my way...

Possible to add text from a Cell?
I know I can choose a text box to add fixed text in a chart but is there a way to add text from a cell that can vary directly from the workbook (e.g. from cell A1)? Insert your text box, select it, and then in the formula bar type your cell address e.g. =Sheet1!A1 You can concatenate your own text to it as well such as ="Total: "&A1 -- Thanks, Christopher This posting is provided "AS IS" with no warranties, and confers no rights. "don.north@gmail.com" wrote: > I know I can choose a text box to add fixed text in a chart but is > there a way to a...

sort text numbers as number
I have a list like this 1-apple 2-orange .... 11-pears 12-grapes.. Now when I sort it, it will sort number 2 after number 12 because it takes it as text, how can I have Excel sort it by the numeric value of the begining of the filed? -- Jacob Fleischman Federal plastics ltee 514-342-5411 jacob@fedplast.com Jacob, You can make a helper column, and sort on that column. =LEFT(A2,SEARCH("-",A2)-1) This should yield the number part at the beginning of the cell - it looks for a hyphen. It will fail if it doesn't find a hyphen; the formula can be expanded to behave more nicely i...

HELP!!! Control Panel->Mail-> ?
I'm running microsoft outlook 2000. I am not able to setup an outlook profile. I've tried Control panel -> Mail -> but I'm directed to setup an internet connection wizard. I don't see a profiles button. Help! You are probably running Outlook in Internet Mail Only mode. Only Corporate or Workgroup uses profiles. Do you need CW mode? If not, IMO is usually best for home users. --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Due to the (insert latest virus name here) virus, all mail sent to my personal account wi...

hovering cursor over footnote number in text
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) I used to be able to hover the cursor over a foot/end note number in the document, and a mini window would show me the note text. All of a sudden, my cursor no longer works this way. I don't think I changed any settings, but can anyone tell me how I might fix this? <br><br>Thanks! Check another document: is that the same? You may have converted that footnote to hard text at some point, in which case there is no note text to show. Sorry: I can't think of anything else... On 11/03/10 5:32 AM, in article...

Dates and "Text-to-Columns"
I have a database in which I am attempting to split a column of dates into three columns. The column looks like this: Closed_date 2/3/1997 1/14/1997 1/10/1997 3/19/1997 I selected the column, clicked Data/Text to Columns, and using the Wizard, specified that the text was delimited by forward slashes. I selected {none} for text qualifier, clicked Date as the "Column Data Format." The data preview window appeared to show exactly what I wanted--the month, day and date parsed into three columns. But when I clicked the Finish button, this is what ...

Help requested on VBA control
I hope someone here may be able to help, I have an XL sheet with some associated VBA code that runs against a dataset that varies in number although the fields are constant:- (Name) (Next Action) (Last Action) (Time to perform next Action) (Time last action was performed) (Flag 1) (Flag 2) (Unique ID Number) The normal User Form only shows the first 5 items as Flags 1 and 2 are hidden, however I needed to give the user the option to change them which I have done by using an input box with the MSG a string created by looping through N names and having StrMSG = StrMSG + N + Name(N). Thi...