Any Possible to add Scroll Bars to SysLink Control in MFC
If there is any chance to add Scroll Bars to SysLink Control in VC++ MFC Application?
Hi J Sathish Kumar,
CLinkCtrl class derive form CWnd class, so it can create with the common windows style WS_VSCROLL. So we could create a syslink control with this style.
https://msdn.microsoft.com/en-us/library/xw25kwch.aspx
PTCHAR url =
_T("Link 2) ")
_T("<A HREF=\"http://msdn2.microsoft.com/en-us/visualc/default.aspx\">")
_T("Microsoft VC++ Home")
_T("</A>");
//m_mylink is a object of a class derive from CLinkCtrl class.
m_mylink.Create(url,
(WS_VISIBLE | WS_TABSTOP | WS_CHILD | WS_BORDER|WS_VSCROLL),
CRect(
100, 100,
400, 240),
this,
IDC_SYSLINK2);
You need to create a class derive form CLinkCtrl class. And you will find the scrollbar cannnot scroll. Here is a workaround:
LRESULT CMyLinkCtrl::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
// TODO: Add your specialized code here and/or call the base class
if (message == WM_NCHITTEST || message == WM_NCLBUTTONDOWN || message == WM_NCLBUTTONDBLCLK)
return ::DefWindowProc(m_hWnd, message, wParam, lParam);
return CLinkCtrl::WindowProc(message, wParam, lParam);
Set the scrollbar information.
int CMyLinkCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)
if (CLinkCtrl::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
SCROLLINFO vinfo;
vinfo.cbSize = sizeof(vinfo);
vinfo.fMask = SIF_ALL;
vinfo.nPage = 30
vinfo.nMax = 140
vinfo.nMin=0;
vinfo.nTrackPos = 0;
SetScrollInfo(SB_VERT, &vinfo);//
return 0;
Handle the WM_VSCROLL message event in your new class CMyLinkCtrl.
void CMyLinkCtrl::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
// TODO: Add your message handler code here and/or call default
SCROLLINFO scrollinfo;
GetScrollInfo(SB_VERT, &scrollinfo, SIF_ALL);
switch (nSBCode) {
case SB_BOTTOM:
ScrollWindow(0, (scrollinfo.nPos - scrollinfo.nMax) * 10); scrollinfo.nPos = scrollinfo.nMax;
SetScrollInfo(SB_VERT, &scrollinfo, SIF_ALL); break;
case SB_TOP: ScrollWindow(0, (scrollinfo.nPos - scrollinfo.nMin) * 10); scrollinfo.nPos = scrollinfo.nMin;
SetScrollInfo(SB_VERT, &scrollinfo, SIF_ALL);
break;
case SB_LINEUP:
scrollinfo.nPos -= 1;
if (scrollinfo.nPos<scrollinfo.nMin) {
scrollinfo.nPos = scrollinfo.nMin;
break;
SetScrollInfo(SB_VERT, &scrollinfo, SIF_ALL);
ScrollWindow(0, 10);
break;
case SB_LINEDOWN:
scrollinfo.nPos += 1;
if (scrollinfo.nPos>scrollinfo.nMax) {
scrollinfo.nPos = scrollinfo.nMax; break;
SetScrollInfo(SB_VERT, &scrollinfo, SIF_ALL); ScrollWindow(0, -10);
break;
case SB_PAGEUP:
scrollinfo.nPos -= 5;
if (scrollinfo.nPos<scrollinfo.nMin) {
scrollinfo.nPos = scrollinfo.nMin;
break;
SetScrollInfo(SB_VERT, &scrollinfo, SIF_ALL); ScrollWindow(0, 10 * 5);
break;
case SB_PAGEDOWN:
scrollinfo.nPos += 5;
if (scrollinfo.nPos>scrollinfo.nMax) {
scrollinfo.nPos = scrollinfo.nMax;
break;
SetScrollInfo(SB_VERT, &scrollinfo, SIF_ALL); ScrollWindow(0, -10 * 5);
break;
case SB_ENDSCROLL:
break;
case SB_THUMBPOSITION:
// ScrollWindow(0,(scrollinfo.nPos-nPos)*10); // scrollinfo.nPos = nPos;
// SetScrollInfo(SB_VERT,&scrollinfo,SIF_ALL);
break;
case SB_THUMBTRACK:
ScrollWindow(0, (scrollinfo.nPos - nPos) * 10);
scrollinfo.nPos = nPos;
SetScrollInfo(SB_VERT, &scrollinfo, SIF_ALL);
break;
CLinkCtrl::OnVScroll(nSBCode, nPos, pScrollBar);
Above code is just for test and help you understand how to add the scrollbar, you could make it more suitable for your situation. Hope this helps some. Example Screenshot:
Best regards,
Shu
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.
Similar Messages
-
How to add scroll bar within af:showDetail
I have added a af:panelGroupLayout to af:showDetail, and set the "layout" property of the panel group layout out to "scroll". However, the scroll bar still does not show up within af:showDetail. If I set the height for the panel group layout within af:showDetail, then the scroll bar shows. But then it will not stretch vertically upon stretching the dialog vertically. Is it possible to add scroll bar within af:showDetail?
Here's a sample code which I tried -
<*af:panelStretchLayout* id="psl1">
<f:facet name="center">
<*af:showDetail* disclosed="false" id="sd1" disclosedText="Metadata"
undisclosedText="Metadata">
<*af:panelGroupLayout* id="pgl2"
inlineStyle="background-color:White;"
layout="*scroll*">
</panelGroupLayout>
</af:showDetail>
</f:facet>
</af:panelStretchLayout>Yes, you can try panelStretchLayout as well.
Copy following fragment into an empty <af:document> to see the difference.
<af:form id="f1">
<af:showDetail disclosed="true" id="sd1">
<af:panelStretchLayout id="psl1">
<f:facet name="bottom"/>
<f:facet name="center">
<af:panelGroupLayout id="pgl1" layout="scroll">
<af:outputFormatted value="outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>"
id="of1"/>
</af:panelGroupLayout>
</f:facet>
<f:facet name="start"/>
<f:facet name="end"/>
<f:facet name="top"/>
</af:panelStretchLayout>
</af:showDetail>
<af:showDetail disclosed="true" id="sd2">
<af:panelGroupLayout id="pgl2" layout="scroll">
<af:outputFormatted value="outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>outputFormat1<p>"
id="of2"/>
</af:panelGroupLayout>
</af:showDetail>
</af:form>
Enjoy ADF...
Todd -
How to add scroll bar in child form ( vb6.0 )
look at this picture link (i think you will understand the issue)
http://tinypic.com/r/25k232u/8
These information(class1,class2 ……) are loaded from database and this time the information is too much and it moves down to the appearing part of the window and unable to view these items
How to add scroll bar in visual basic child form so that the data items can be viewed by scroll in case it go beyond the screen.Hi,
Welcome to MSDN.
I am afraid that these forums donot support VB6 any more, you could refer to this thread:
Where to post your VB 6 questions
You could consider posting this issue in these forums below:
These forums do not support Visual Basic 6, however there are many third-party support sites that do. If you have a VB6-related question please visit these popular forums:
VB Forums
VB City
Thanks for your understanding.
Regards.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
How to add scroll bar in webi table
Hi Experts,
Currently i am working on webi report it consist lot of tables and charts. As per my requirement the webi table should contain scroll bar instead of showing all data in single shot. And user will scroll down if he/she required. Is it possible in webi?
Regards,
PRK.Hi Praveen,
Adding scroll ball in Webi table is not possible currently.
Requests has been raised by some people in SAP Idea place, see the link below for more details.
You can vote in SAP Idea place for getting this feature
Add scroll bars for Webi tables : View Idea -
How to add scroll bar to a labview wave graph?
I want to know if there is a to add scroll bar to a labview wave graph.
Look here:
http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=5065000000080000001E400000&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0 -
Remove vertical scroll bar from table control
hi,
i had used table control in my application. i want remove vertical scroll bar from table control.
At initial time in table control there is no vertical scroll bar. In my table control lines are dependent on internal table which i was used to fill it.
i was used these code for to set table control lines.
DESCRIBE TABLE IT_RISK_ZINRISEXC LINES EXC_LINE.
TC_RISK_EX-LINES = EXC_LINE .
Initially there is no data in internal table so there is no vertical scroll bar. After getting value i am filling internal table. and there is scroll bar in my table control. but i does not want that.
i was not selected RESIZING-VERTICAL OR -HORIZONTAL.Hi,
From Scroll Bars in Table Control
You can remove the scroll bar in the table control by switching off horizontal and vertical scrolling in the properties of the table control. The properties can be accessed from the screen painter by double clicking on the table control. Regarding the page up and page down functions, I believe you add those buttons in the screen layout and code for them. You can use the standard function code for the page up and page down functions.
or
You can get rid of the vertical scroll bars by not setting table control lines. This way the user can only see the visible lines of the table control. As for the horizontal scrollbar, just make sure that your table control doesn't contain too many fields.
Regards,
Raj. -
Scroll bar in table control without wizard
Dear All,
I have made a module pool program for gate pass. In which i have taken a TABLE CONTROL WITHOUT WIZARD. Now my problem is , the table control does not have the SCROLL BAR functionality. It is not showing the scroll bar also. So can any one of you can help with the code that i can use to bring that scroll bar.
Table control is without wizard.
Thanks & Regards
VijjuHi,
In PBO module write the code as,
data: fill TYPE i.
DESCRIBE TABLE itab LINES fill.
flights-lines = fill.
Flights is the table control name in screen and itab is the internal table name.
Regards
Haritha
Edited by: Haritha Teegala on Jan 6, 2012 7:53 AM -
Urgent!!!!Add a Horizontal Scroll Bar for Table Control
Hi Experts,
I want to have a Horizontal Scroll Bar on my Table control.
I tried with few properties for the Table UI Element but not able to solve it.
If any one who had already done this please help me out.
Thanks in advance..
Regards, Kishore KHI Koen,
Thanks for early Reply.
When I use this I get
Page Down ( ->!!, Arrown with lines pointing Down)
Page UP
Page Top ( ->, Arrown with lines pointing Top)
Page Down ( ->, Arrown with lines pointing Down)
But I need only Page top and Page down for this Table UI .
I think my question is clear enough.
Please let me know this also.
Thanks & Regards,
Kishore K -
Possible defect - verticle scroll bar; Recommended enhancement
Just finished my first screenplay in story and am now editing.
Possible defect - I try to scroll down a single page by clicking on the verticle scroll bar. The script jumps several (from a few to a dozen pages) down. This is unexpected. In most typical 'windows' apps, the scroll bar lets you move up or down a page at a time when you click the space above (or below) the icon that indicates the page you are on (I don't know what that icon is called).
Recommended Enhancement - So, I've started using the PgDn button to navigate while editing/reading. I've found a minor inconvenience with this process. When I hit the PgDn button, story scrolls a full window down and I can't see the last line I read (it's now off the screen). I recommend changing this so that when you hit PgDn the last line of the current page becomes the first line of the 'new' page. That would make for a smoother transition, easier reading and editing.
Thanks for a truly terrific tool.
Joe G.I've found the scrolling with the mouse wheel either doesn't work or requires a couple of attempts to start scrolling.
-
How to add scroll bars to a panel
Hi
Can anyone plz tell me how to add a scroll bar to a panel created within a JFrame
Regards
atsimport javax.swing.*;
import java.awt.*;
class Testing extends JFrame
public Testing()
setLocation(300,200);
setDefaultCloseOperation(EXIT_ON_CLOSE);
JPanel jp = new JPanel();
jp.add(new JLabel("Label on a panel"));
jp.setPreferredSize(new Dimension(200,300));
JScrollPane sp = new JScrollPane(jp);
sp.setPreferredSize(new Dimension(200,200));
getContentPane().add(sp);
pack();
public static void main(String args[]){new Testing().setVisible(true);}
} -
How to add scroll bar to JDesktopPane?
Hi All,
After download the "InternalFrameDemo.java" from the swing tutorial, I want to add scrollbars to JDesktopPane so that whenever a internal frame moves off the desktop view port, a scrollbar will display. I have tried many ways to implement this but no success.
Do you know how to add scrollbars to JDesktopPane?
Thanks
AnsonYou can't get there from here! Assuming that wou want is to make the desktop scrollable that is.
The trick to make somthing scrollable is to make JScrollPane CONTAIN the component to be scrolled. If you could ask the desktop to return the component it contains, you might have a chance but no luck, the desktop pane actually inherits a layered pane which is most likey is what you would like JScrollPane to contain.
Now here's another angle to this story... the desktop is complex enough without scrollbars, why would you want to complicate things by adding a scroll bar anyway? Say one of its window is maximized and has a scrollbar of its own AND the desktop has one.... that makes TWO scroll bars side by side. Talk about confusing.
I believe the desktop was designed so scroll bars can't be added for a very good reason: good UI practises. -
Add scroll bars to TextArea - how?
I have an application which reads user input to a text file and then on click of JButDisplay reads the contents of the file to a TextArea.
Problem is I can't seem to get scroll bars onto the TextArea, I tried using JScrollPane,
but had no luck (I'm using gridBagLayout)
Could someone please advise me how to add scrollbars to this component?
TADisplay2 = new JTextArea(10,20);
c.ipadx = 12;
c.ipady = 12;
c.gridx = 2;
c.gridy=18;
c.gridwidth = 2; //2 columns wide
c.gridheight = 4;
gridbag.setConstraints(TADisplay2, c);
contentPane.add(TADisplay2);1) Create scrollPanel
2) Make it fill your content pane (or whatever area you wish to cover)
3) Add your textArea to the scrollpanel -
Add Scroll Bars around Large JPG Image - JDev 11.1.2
Hello:
I have a panel tabbed componet and inside one of the show detail items, I would like to put a rather large image. I can put the af:image into the show detail item, but neither horizontal or vertal scroll bars appear, so I can only see the upper left corner of the JPG image. How can I make horizontal and vertical scroll bars appear around the image?
Thanks for the help.Try to put the image into a panelGroupLayout in scroll mode...
Timo -
Hi,
How do I remove the vertical and horizontal scroll bars in the table control? I would like to use the Pg Up/Down buttons instead.
Thanks,
Mounika.Mounika,
You can add or remove the scroll bar in the table control by switching off horizontal and vertical scrolling in the properties of the table control. The properties can be accessed from the screen painter by double clicking on the table control. Regarding the page up and page down functions, I believe you add those buttons in the screen layout and code for them. You can use the standard function code for the page up and page down functions.
Regarding the Page up Page down...You need to add some extra code in your program to activvate that. Check the following program for example.
DEMO_DYNPRO_TABCONT_LOOP_AT
or try something like this
try something like:
CASE sy-ucomm.
WHEN 'P+' OR
'P++' OR
'P-' OR
'P--'
CALL FUNCTION 'SCROLLING_IN_TABLE'
EXPORTING
entry_act = tc-top_line
entry_to = tc-lines
last_page_full = 'X'
loops = loops
ok_code = sy-ucomm
overlapping = 'X'
IMPORTING
entry_new = tc-top_line
EXCEPTIONS
no_entry_or_page_act = 1
no_entry_to = 2
no_ok_code_or_page_go = 3
OTHERS = 4
ENDCASE .
Hope this helps
Vinodh Balakrishnan -
Vertical scroll bar in table control with wizrads
Hi,
Im working on a table control with a customised table. I created a table control with wizards. But vertical scroll bar is not working. How can i invoke vertical scroll bar and can any one provide the code for the all the operations on a table control like save,find,find next,change....Thanks in advance.
AvinashHi Avinash
move the records number of your internal table into field LINES of tablecontrol. So you should change the code generated by wizard in PBO, for example create a new module:
PROCESS PBO
MODULE SET_DATA_TO_T_CTRL.
LOOP..
ENDLOOP.
MODULE SET_DATA_TO_T_CTRL.
DESCRIBE TABLE ITAB LINE SY-TABIX.
<TABLECONTROL>-LINES = SY-TABIX.
ENDMODULE.
Max
Maybe you are looking for
-
Hello SDN Community, I was able to get a list of row numbers returned from GET_SELECTED_ROWS when I added a call to GET_METADATA. However, GET_SELECTED_ROWS only works the first time. When I return to the screen, the lines are still highlighted and
-
Logic X with rMBP SSD 16gb RAM insane CPU problem.
Hi, just got a brand new MacBookPro retina SSD 2.3 Ghz Intel Core i7, 16 gb RAM. The reason I bought this was because I was told it shall solve efficiency problems when working with LogicPro. Well, it didnt. It acts 10 times worse than my older MacBo
-
Being redirected to built in FB app while trying to use www FB on Pre
I have been using the full www FB on my Pre happily for months with no problems. Just today when I type the URL it redirects me to the built in FB app. I've cleared cache/history and restarted several times and even removed the bookmark. I hate the b
-
I cant plug it into my itunes because my laptop is being fixed.. but even if when it comes back all the data will be lost so if I restore my iphone everything will be lost because I have no backed it up with icloud. I need a way of fixing it without
-
Safari 4.1.3 keeps crashing
I've reinstalled Flash, deleted cookies, repaired permissions, and tried to reinstall Safari (but it said the disk wouldn't mount). I'm running out of ideas. Any help would be appreciated. Crash report: Date/Time: 2012-01-01 22:41:04.753 -070