当前位置: 首页>>代码示例>>C#>>正文


C# SCROLLINFO类代码示例

本文整理汇总了C#中SCROLLINFO的典型用法代码示例。如果您正苦于以下问题:C# SCROLLINFO类的具体用法?C# SCROLLINFO怎么用?C# SCROLLINFO使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SCROLLINFO类属于命名空间,在下文中一共展示了SCROLLINFO类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DetailsListView

 public DetailsListView()
 {
     AllowColumnReorder = true;
     Dock = DockStyle.Fill;
     FullRowSelect = true;
     HideSelection = false;
     Location = new Point(0, 0);
     Margin = new Padding(0);
     Name = string.Format("CList{0}", Environment.TickCount);
     ShowItemToolTips = true;
     Size = new Size(380, 260);
     UseCompatibleStateImageBehavior = false;
     View = View.Details;
     OwnerDraw = true;
     VirtualMode = true;
     AllowDrop = true;
     View = View.Details;
     FullRowSelect = true;
     HideSelection = false;
     DoubleBuffered = true;
     _scrollInfo = new SCROLLINFO
         {
             cbSize = (uint)Marshal.SizeOf(_scrollInfo),
             fMask = (uint)ScrollInfoMask.SIF_POS
         };
 }
开发者ID:t-ashula,项目名称:hoehoe2,代码行数:26,代码来源:DetailsListView.cs

示例2: ScrolledToBottom

        private bool ScrolledToBottom()
        {
            Scroll = new SCROLLINFO();
            Scroll.size = Convert.ToUInt32(Marshal.SizeOf(Scroll));
            Scroll.mask = 7;

            if (!GetScrollInfo(Handle, 1, ref Scroll))
                return true;
            return (Scroll.page == 0) || ((Scroll.page + Scroll.position) >= Scroll.max);
        }
开发者ID:banksyhf,项目名称:Auxilium-2,代码行数:10,代码来源:RichTextBox.cs

示例3: GetScrollInfoStruct

        private SCROLLINFO GetScrollInfoStruct(RichTextBox tbb)
        {
            SCROLLINFO SCInfo = new SCROLLINFO();

            SCInfo.cbSize = (uint)Marshal.SizeOf(SCInfo);     //この2行は必須
            SCInfo.fMask = (int)ScrollInfoMask.SIF_ALL;

            GetScrollInfo(tbb.Handle, (int)ScrollBarDirection.SB_VERT, ref SCInfo);
            return SCInfo;
        }
开发者ID:rusutaku,项目名称:csharp-tororo-gui,代码行数:10,代码来源:ScrollInfo.cs

示例4: IsEndOfScroll

        private bool IsEndOfScroll()
        {
            SCROLLINFO SCInfo = new SCROLLINFO();

            SCInfo.cbSize = (uint)Marshal.SizeOf(SCInfo);     //この2行は必須
            SCInfo.fMask  = (int)ScrollInfoMask.SIF_ALL;

            GetScrollInfo(rTextBoxOut.Handle, (int)ScrollBarDirection.SB_VERT, ref SCInfo);
            if (SCInfo.nPos >= SCInfo.nMax - Math.Max(SCInfo.nPage, 0))
            {
                return true;
            }
            return false;
        }
开发者ID:rusutaku,项目名称:csharp-tororo-gui,代码行数:14,代码来源:ScrollInfo.cs

示例5: SetScrollBar

        public void SetScrollBar(int Position, uint Page, int nMin, int nMax, out int TrackPosition)
        {
            SCROLLINFO VScrInfo = new SCROLLINFO();
            GetScrollInfo(this.Handle, (int)ScrollBarDirection.SB_HORZ, ref VScrInfo);
            VScrInfo.cbSize = (uint)Marshal.SizeOf(VScrInfo);
            VScrInfo.nPos = Position;
            VScrInfo.nPage = Page;
            VScrInfo.nMin = nMin;
            VScrInfo.nMax = nMax;
            TrackPosition = VScrInfo.nTrackPos;

            VScrInfo.fMask = (int)ScrollInfoMask.SIF_POS + (int)ScrollInfoMask.SIF_PAGE
              + (int)ScrollInfoMask.SIF_RANGE + (int)ScrollInfoMask.SIF_DISABLENOSCROLL;
            SetScrollInfo(this.Handle, (int)ScrollBarDirection.SB_HORZ, ref VScrInfo, true);
        }
开发者ID:kse-jp,项目名称:RM-3000,代码行数:15,代码来源:HScrollBarEx.cs

示例6: GetScrollPosition

		public bool GetScrollPosition(out int ScrollY)
		{
			SCROLLINFO ScrollInfo = new SCROLLINFO();
			ScrollInfo.cbSize = Marshal.SizeOf(ScrollInfo);
			ScrollInfo.fMask = SIF_ALL;
			if(GetScrollInfo(Handle, SB_VERT, ScrollInfo) == 0)
			{
				ScrollY = 0;
				return false;
			}
			else
			{
				ScrollY = ScrollInfo.nPos;
				return true;
			}
		}
开发者ID:zhaoyizheng0930,项目名称:UnrealEngine,代码行数:16,代码来源:BuildListControl.cs

示例7: Scroll

 public void Scroll(int pixels)
 {
     var si = new SCROLLINFO();
     si.cbSize = (uint)Marshal.SizeOf(si);
     si.fMask = (uint)ScrollInfoMask.SIF_ALL;
     GetScrollInfo(Handle, (int)ScrollBarDirection.SB_VERT, ref si);
     si.nPos += pixels;
     if (si.nPos < 0)
     {
         si.nPos = 0; // stop scrolling from wrapping around at the top
     }
     SetScrollInfo(Handle, (int)ScrollBarDirection.SB_VERT, ref si, true);
     var ptrWparam = new IntPtr(SB_THUMBTRACK + 0x10000 * si.nPos);
     var ptrLparam = new IntPtr(0);
     SendMessage(Handle, WM_VSCROLL, ptrWparam, ptrLparam);
 }
开发者ID:osin-vladimir,项目名称:EyeX,代码行数:16,代码来源:ScrollTextBox.cs

示例8: if

        // Workaround for only partially visible list view items
        /* public static void EnsureVisible(ListView lv, int nIndex, bool bPartialOK)
        {
            Debug.Assert(lv != null); if(lv == null) return;
            Debug.Assert(nIndex >= 0); if(nIndex < 0) return;
            Debug.Assert(nIndex < lv.Items.Count); if(nIndex >= lv.Items.Count) return;

            int nPartialOK = (bPartialOK ? 1 : 0);
            try
            {
                NativeMethods.SendMessage(lv.Handle, LVM_ENSUREVISIBLE,
                    new IntPtr(nIndex), new IntPtr(nPartialOK));
            }
            catch(Exception) { Debug.Assert(false); }
        } */
        public static int GetScrollPosY(IntPtr hWnd)
        {
            try
            {
                SCROLLINFO si = new SCROLLINFO();
                si.cbSize = (uint)Marshal.SizeOf(si);
                si.fMask = (uint)ScrollInfoMask.SIF_POS;

                if(GetScrollInfo(hWnd, (int)ScrollBarDirection.SB_VERT, ref si))
                    return si.nPos;

                Debug.Assert(false);
            }
            catch(Exception) { Debug.Assert(false); }

            return 0;
        }
开发者ID:elitak,项目名称:keepass,代码行数:32,代码来源:NativeMethods.New.cs

示例9: GetScrollInfo

 public static extern int GetScrollInfo(int hwnd, int n, ref SCROLLINFO lpScrollInfo);
开发者ID:lolindrath,项目名称:dragonsong,代码行数:1,代码来源:Win32Helper.cs

示例10: GetScrollInfo

 public static extern bool GetScrollInfo(IntPtr hWnd, int fnBar, SCROLLINFO si);
开发者ID:seriesrenamer,项目名称:seriesrenamer,代码行数:1,代码来源:NativeMethods.cs

示例11: GetScrollInfo

 private static extern bool GetScrollInfo(IntPtr hwnd, int fnBar, ref SCROLLINFO lpsi);
开发者ID:deveck,项目名称:Deveck.Utils,代码行数:1,代码来源:CustomListView.cs

示例12: scrollHoz

        void scrollHoz(IntPtr handle, int pixels)
        {
            scrollLB(handle);

            //ShowScrollBar(handle, (int)ScrollBarDirection.SB_HORZ, (bool)false);

            // Get current scroller posion

            SCROLLINFO si = new SCROLLINFO();
            si.cbSize = (uint)Marshal.SizeOf(si);
            si.fMask = (uint)ScrollInfoMask.SIF_ALL;
            GetScrollInfo(handle, (int)ScrollBarDirection.SB_HORZ, ref si);

            // Increase posion by pixles
            si.nPos += pixels;
            if (si.nPos > (si.nMax - si.nPage) * 1.5) si.nPos = (int)((si.nMax - si.nPage) * 1.5);
            if (si.nPos < 0) si.nPos = 0;

            /*
            if (si.nPos < (si.nMax - si.nPage))
                si.nPos += pixels;
            else
            {
                SendMessage(handle, WM_HSCROLL, (IntPtr)ScrollBarCommands.SB_PAGERIGHT, IntPtr.Zero);
            }
             */

            // Reposition scroller
            SetScrollInfo(handle, (int)ScrollBarDirection.SB_HORZ, ref si, true);

            // Send a WM_HSCROLL scroll message using SB_THUMBTRACK as wParam
            // SB_THUMBTRACK: low-order word of wParam, si.nPos high-order word of wParam
            SendMessage(handle, WM_HSCROLL, (IntPtr)(ScrollBarCommands.SB_THUMBTRACK + 0x10000 * si.nPos), IntPtr.Zero);
        }
开发者ID:futurist,项目名称:barcodeLY,代码行数:34,代码来源:frmPackageList.cs

示例13: GetScroll

 private SCROLLINFO GetScroll()
 {
     SCROLLINFO si = new SCROLLINFO();
     si.cbSize = Marshal.SizeOf(si);
     si.fMask = SIF_PAGE | SIF_POS | SIF_RANGE;
     GetScrollInfo(this.Handle, SB_VERT, ref si);
     return si;
 }
开发者ID:newyorknight,项目名称:jabber.net,代码行数:8,代码来源:BottomScrollRichText.cs

示例14: scroll

        // Scrolls a given textbox. handle: an handle to our textbox. pixels: number of pixels to scroll.
        long scroll(IntPtr handle, int pixels)
        {
            long pixelsToEnd = 0;
            IntPtr ptrLparam = new IntPtr(0);
            IntPtr ptrWparam;
            // Get current scroller posion
            
            SCROLLINFO si = new SCROLLINFO();
            si.cbSize = (uint)Marshal.SizeOf(si);
            si.fMask = (uint)ScrollInfoMask.SIF_ALL;
            GetScrollInfo(handle, (int)ScrollBarDirection.SB_VERT, ref si);           

            // Increase posion by pixles
            pixelsToEnd = (si.nMax - si.nPage) - (si.nPos + pixels);
            if (si.nPos < (si.nMax - si.nPage))
                si.nPos += pixels;
            else
            {
                ptrWparam = new IntPtr(SB_ENDSCROLL);
                t.Enabled = false;
                SendMessage(handle, WM_VSCROLL, ptrWparam, ptrLparam);                
            }
                        
            // Reposition scroller
            SetScrollInfo(handle, (int)ScrollBarDirection.SB_VERT, ref si, true);

            // Send a WM_VSCROLL scroll message using SB_THUMBTRACK as wParam
            // SB_THUMBTRACK: low-order word of wParam, si.nPos high-order word of wParam
            ptrWparam = new IntPtr(SB_THUMBTRACK + 0x10000 * si.nPos);            
            SendMessage(handle, WM_VSCROLL, ptrWparam, ptrLparam);
            return pixelsToEnd;
        }
开发者ID:ByteSempai,项目名称:Ubiquitous,代码行数:33,代码来源:ExRichTextBox.cs

示例15: GetScrollInfo

 private static extern bool GetScrollInfo(IntPtr handle, int bar, ref SCROLLINFO info);
开发者ID:banksyhf,项目名称:Auxilium-2,代码行数:1,代码来源:RichTextBox.cs


注:本文中的SCROLLINFO类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。