Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

c# - Manually telling my ListBox's scrollbar where to be -


private void button2_click(object sender, eventargs e) {     listbox1.autoscrolloffset.y = 10; } 

i'm trying manually set location of vertical scrollbar using code during runtime. i've tried.

the .y property says: "gets or sets y coordinate of point". why doesn't compile , give me exception:

error 1 cannot modify return value of 'system.windows.forms.control.autoscrolloffset' because not variable

this crucial difference between value types , reference types. autoscrolloffset of type point, struct makes value type. when use property getter, copy of value. setting y property sets property on copy. c# compiler can recognize particular usage problem. not one:

private void button2_click(object sender, eventargs e) {     var offset = listbox1.autoscrolloffset;     offset.y = 10;     // compiles, doesn't work } 

to make work if have assign property value of type point:

private void button2_click(object sender, eventargs e) {     listbox1.autoscrolloffset = new point(listbox1.autoscrolloffset.x, 10); } 

which not work scroll listbox, affect position of control when embedded in scrollable container, panel. check scrollcontrolintoview reference.

assign topindex property instead.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -