dcsimg
How can i scroll the inner composite?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   eclipse_programmer
Posted On:   Wednesday, October 29, 2008 01:15 AM

Can anybody help me, How can i scroll the composite c2 which is on another composite c1. How can i scroll only the c2. c2 is fixed size ..eg: width=400 and height = 200, if the controls added to c2 are having more than 200 size, the i would like to scroll the c2. i tried like, ScrolledComposite sc=new ScrolledComposite(grp,SWT.BORDER|SWT.V_SCROLL); sc.setLayout(new GridLayout(1,false)); c = new Composite(sc,SWT.NONE); c.setLayout(new GridLayout(1,false)); GridData gd=new GridData((GridData.FILL_HORIZONTAL)); c.setLayoutData(gd); // add some controls to c c.setSize(SWT.DEFAULT, 20   More>>

Can anybody help me,

How can i scroll the composite c2 which is on another composite c1.

How can i scroll only the c2.

c2 is fixed size ..eg: width=400 and height = 200,
if the controls added to c2 are having more than 200 size, the i would like to scroll the c2.



i tried like,



ScrolledComposite sc=new ScrolledComposite(grp,SWT.BORDER|SWT.V_SCROLL);

sc.setLayout(new GridLayout(1,false));

c = new Composite(sc,SWT.NONE);

c.setLayout(new GridLayout(1,false));

GridData gd=new GridData((GridData.FILL_HORIZONTAL));

c.setLayoutData(gd);

// add some controls to c


c.setSize(SWT.DEFAULT, 200);

sc.setContent(c);

sc.setExpandHorizontal(true);

sc.setMinWidth(200);



But it is not working..

Composite c is displayed of hieght 200. but no scroll bar..



what to do...

   <<Less
About | Sitemap | Contact