<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Winform - HaiNH</title>
	<atom:link href="https://hainh.dev/tag/winform/feed/" rel="self" type="application/rss+xml" />
	<link>https://hainh.dev</link>
	<description></description>
	<lastBuildDate>Thu, 16 Oct 2025 17:18:55 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://hainh.dev/wp-content/uploads/2025/10/cropped-logomyblog-32x32.png</url>
	<title>Winform - HaiNH</title>
	<link>https://hainh.dev</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">249252746</site>	<item>
		<title>DatagridView bị tình trạng giật lag nhấp nháy khi cuộn dòng trong winform</title>
		<link>https://hainh.dev/datagridview-bi-tinh-trang-giat-lag-nhap-nhay-khi-cuon-dong-trong-winform/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=datagridview-bi-tinh-trang-giat-lag-nhap-nhay-khi-cuon-dong-trong-winform</link>
					<comments>https://hainh.dev/datagridview-bi-tinh-trang-giat-lag-nhap-nhay-khi-cuon-dong-trong-winform/#respond</comments>
		
		<dc:creator><![CDATA[NGUYỄN HOÀNG HẢI]]></dc:creator>
		<pubDate>Thu, 27 Oct 2022 06:01:41 +0000</pubDate>
				<category><![CDATA[Lập trình ứng dụng]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[lập trình ứng dụng]]></category>
		<category><![CDATA[Winform]]></category>
		<guid isPermaLink="false">https://hainh2k3.com/?p=4194</guid>

					<description><![CDATA[<p>Nếu các bạn sử dụng DataGridView mà khi cuộn các dòng dữ liệu gặp tình trạng giật lag, nhấp nháy (flickering) thì hãy sử dụng giải pháp set DoubleBuffered = True, gần như tất cả control đều có thuộc tính này nhưng DataGridView thì lại bị ẩn đi. Chúng ta chỉ cẩn sử dụng đoạn...</p>
<p>The post <a href="https://hainh.dev/datagridview-bi-tinh-trang-giat-lag-nhap-nhay-khi-cuon-dong-trong-winform/">DatagridView bị tình trạng giật lag nhấp nháy khi cuộn dòng trong winform</a> first appeared on <a href="https://hainh.dev">HaiNH</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Nếu các bạn sử dụng DataGridView mà khi cuộn các dòng dữ liệu gặp tình trạng giật lag, nhấp nháy (flickering) thì hãy sử dụng giải pháp  set DoubleBuffered = True, gần như tất cả control đều có thuộc tính này nhưng DataGridView thì lại bị ẩn đi. Chúng ta chỉ cẩn sử dụng đoạn code dưới đây để bật thuộc tính này cho các control cần thiết.</p>



<div class="wp-block-kevinbatdorf-code-block-pro padding-disabled cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#000000;--cbp-line-number-width:calc(1 * 0.6 * .875rem);--cbp-line-highlight-color:rgba(0, 0, 0, 0.2);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span style="display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#FFFFFF"><svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg></span><span role="button" tabindex="0" style="color:#000000;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>public static void SetDoubleBuffered(Control control)
{
  // set instance non-public property with name "DoubleBuffered" to true
  typeof(Control).InvokeMember("DoubleBuffered",
      BindingFlags.SetProperty | BindingFlags.Instance | BindingFlags.NonPublic,
      null, control, new object[] { true });
}</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki light-plus" style="background-color: #FFFFFF" tabindex="0"><code><span class="line"><span style="color: #0000FF">public</span><span style="color: #000000"> </span><span style="color: #0000FF">static</span><span style="color: #000000"> </span><span style="color: #0000FF">void</span><span style="color: #000000"> </span><span style="color: #795E26">SetDoubleBuffered</span><span style="color: #000000">(</span><span style="color: #267F99">Control</span><span style="color: #000000"> </span><span style="color: #001080">control</span><span style="color: #000000">)</span></span>
<span class="line"><span style="color: #000000">{</span></span>
<span class="line"><span style="color: #008000">  // set instance non-public property with name &quot;DoubleBuffered&quot; to true</span></span>
<span class="line"><span style="color: #000000">  </span><span style="color: #0000FF">typeof</span><span style="color: #000000">(</span><span style="color: #267F99">Control</span><span style="color: #000000">).</span><span style="color: #795E26">InvokeMember</span><span style="color: #000000">(</span><span style="color: #A31515">&quot;DoubleBuffered&quot;</span><span style="color: #000000">,</span></span>
<span class="line"><span style="color: #000000">      </span><span style="color: #001080">BindingFlags</span><span style="color: #000000">.</span><span style="color: #001080">SetProperty</span><span style="color: #000000"> | </span><span style="color: #001080">BindingFlags</span><span style="color: #000000">.</span><span style="color: #001080">Instance</span><span style="color: #000000"> | </span><span style="color: #001080">BindingFlags</span><span style="color: #000000">.</span><span style="color: #001080">NonPublic</span><span style="color: #000000">,</span></span>
<span class="line"><span style="color: #000000">      </span><span style="color: #0000FF">null</span><span style="color: #000000">, </span><span style="color: #001080">control</span><span style="color: #000000">, </span><span style="color: #0000FF">new</span><span style="color: #000000"> </span><span style="color: #0000FF">object</span><span style="color: #000000">[] { </span><span style="color: #0000FF">true</span><span style="color: #000000"> });</span></span>
<span class="line"><span style="color: #000000">}</span></span></code></pre></div>



<p>Khi sử dụng chỉ cần gọi vd: gdv.SetDoubleBuffered() ở form_load chẳng hạn, vd kết quả sẽ như dưới đây</p>



<figure class="wp-block-image size-full"><img fetchpriority="high" decoding="async" width="537" height="301" data-attachment-id="4195" data-permalink="https://hainh.dev/datagridview-bi-tinh-trang-giat-lag-nhap-nhay-khi-cuon-dong-trong-winform/setdoublebuffered-true/" data-orig-file="https://hainh.dev/wp-content/uploads/2022/10/SetDoubleBuffered-true-1.gif" data-orig-size="537,301" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="SetDoubleBuffered-true" data-image-description="" data-image-caption="" data-medium-file="https://hainh.dev/wp-content/uploads/2022/10/SetDoubleBuffered-true-1-300x168.gif" data-large-file="https://hainh.dev/wp-content/uploads/2022/10/SetDoubleBuffered-true-1.gif" src="https://hainh.dev/wp-content/uploads/2022/10/SetDoubleBuffered-true-1.gif" alt="" class="wp-image-4195"/></figure><p>The post <a href="https://hainh.dev/datagridview-bi-tinh-trang-giat-lag-nhap-nhay-khi-cuon-dong-trong-winform/">DatagridView bị tình trạng giật lag nhấp nháy khi cuộn dòng trong winform</a> first appeared on <a href="https://hainh.dev">HaiNH</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://hainh.dev/datagridview-bi-tinh-trang-giat-lag-nhap-nhay-khi-cuon-dong-trong-winform/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">4194</post-id>	</item>
	</channel>
</rss>
