• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# SCROLLINFO类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: SetScrollBar

        private void SetScrollBar()
        {
            SCROLLINFO si = new SCROLLINFO();
            si.cbSize = (uint)Marshal.SizeOf(si);
            si.fMask = SIF_ALL;
            int r = GetScrollInfo(this.txtContent.Handle, SB_VERT, ref si);
            pageLine = (int)si.nPage;
            this._vScrollBar1.LargeChange = pageLine;

            if (si.nMax >= si.nPage)
            {
                this._vScrollBar1.Visible = true;
                this._vScrollBar1.Maximum = si.nMax;
                this._vScrollBar1.Value = si.nPos;
            }
            else
                this._vScrollBar1.Visible = false;
        }
开发者ID:ceie246,项目名称:MIPS246_Software,代码行数:18,代码来源:Form1.cs


示例17: txtContent_SizeChanged

 //文本框大小改变
 private void txtContent_SizeChanged(object sender, EventArgs e)
 {
     SCROLLINFO si = new SCROLLINFO();
     si.cbSize = (uint)Marshal.SizeOf(si);
     si.fMask = SIF_ALL;
     int r = GetScrollInfo(this.txtContent.Handle, SB_VERT, ref si);
     pageLine = (int)si.nPage;
     _timer1.Enabled = true;
     ShowRow();
 }
开发者ID:ceie246,项目名称:MIPS246_Software,代码行数:11,代码来源:Form1.cs


示例18: SetVScrollPos

        /// <summary>
        /// Vertically scroll to an absolute position.
        /// </summary>
        /// <param name="scrollPos">The position to scroll to.</param>
        public void SetVScrollPos(int scrollPos)
        {
            int prevScrollPos = 0;
            SCROLLINFO currentInfo = new SCROLLINFO();
            currentInfo.cbSize = Marshal.SizeOf(currentInfo);
            currentInfo.fMask = (int)ScrollInfoMask.SIF_ALL;

            if (GetScrollInfo(this.Handle, (int)ScrollBarDirection.SB_VERT, ref currentInfo) == 0)
            {
                //Debug.WriteLine("Error getting scroll info");
                prevScrollPos = scrollPos;
            }
            else
                prevScrollPos = currentInfo.nPos;

            //The LVM_SCROLL message will take a delta-x and delta-y which tell the list view how
            //much to scroll, relative to the current scroll positions. We are getting the scroll
            //position as an absolute position, so some adjustments are necessary:
            scrollPos -= prevScrollPos;
            //Send the LVM_SCROLL message to scroll the list view.
            SendMessage(new HandleRef(null, this.Handle), (uint)ListViewMessages.LVM_SCROLL, (IntPtr)0, (IntPtr)scrollPos);
        }
开发者ID:svn2github,项目名称:fiddler-plus,代码行数:26,代码来源:ListViewEx.cs


示例19: SetScrollInfo

 private static extern int SetScrollInfo(IntPtr hWnd, int fnBar, ref SCROLLINFO lpsi, bool fRedraw);
开发者ID:newyorknight,项目名称:jabber.net,代码行数:1,代码来源:BottomScrollRichText.cs


示例20: GetVScrollPos

        public int GetVScrollPos()
        {
            SCROLLINFO currentInfo = new SCROLLINFO();
            currentInfo.cbSize = Marshal.SizeOf(currentInfo);
            currentInfo.fMask = (int)ScrollInfoMask.SIF_ALL;

            if (GetScrollInfo(this.Handle, (int)ScrollBarDirection.SB_VERT, ref currentInfo) != 0)
                return currentInfo.nPos;
            //else {
            //Debug.WriteLine("Error getting scroll info");
            //prevScrollPos = 0;
            //}
            return 0;
        }
开发者ID:svn2github,项目名称:fiddler-plus,代码行数:14,代码来源:ListViewEx.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# SCardError类代码示例发布时间:2022-05-24
下一篇:
C# SC类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap