<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6064719148837444379</id><updated>2011-04-21T21:29:26.925-07:00</updated><title type='text'>Cplusplus Source Code</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default?start-index=101&amp;max-results=100'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>115</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-9182554613612210782</id><published>2008-06-10T07:38:00.001-07:00</published><updated>2008-06-10T07:38:38.525-07:00</updated><title type='text'>Streaming SIMD Extensions 2 Instructions</title><content type='html'>&lt;span style="color:#ffff00;"&gt;Microsoft SpecificThis section describes the C/C++ language-level features supporting the Streaming SIMD Extensions 2 (SSE2) instructions:&lt;br /&gt;Floating-Point Intrinsics Using Streaming SIMD Extensions 2 Instructions that describe the intrinsic operations for the double-precision, floating-point data type (__m128d).&lt;br /&gt;Integer Intrinsics Using Streaming SIMD Extensions 2 that describe the intrinsics for the extended-precision integer data type (__m128i).&lt;br /&gt;Other topics discussed in this section include:&lt;br /&gt;Floating-Point Memory and Initialization Operations Using Streaming SIMD Extensions 2&lt;br /&gt;Cache Support for Streaming SIMD Extensions 2 Floating-Point Operations&lt;br /&gt;Integer Memory and Initialization Using Streaming SIMD Extensions 2&lt;br /&gt;Cache Support for Streaming SIMD Extensions 2 Integer Operations&lt;br /&gt;Macro Function for Shuffle Using Streaming SIMD Extensions 2&lt;br /&gt;The emmintrin.h header file contains the declarations for the SSE2 instructions intrinsics. The file dvec.h contains operator overloads for some of the SSE2 instructions intrinsics, which are available for use in C++ programs.&lt;br /&gt;SSE2 intrinsics use the __m128, __m128i, and __m128d data types, which are not supported on Itanium Processor Family (IPF) processors. Any SSE2 intrinsics that use the __m64 data type are not supported on x64 processors.&lt;br /&gt;END Microsoft Specific&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-9182554613612210782?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/9182554613612210782/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=9182554613612210782' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/9182554613612210782'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/9182554613612210782'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/streaming-simd-extensions-2.html' title='Streaming SIMD Extensions 2 Instructions'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-2828428495143953366</id><published>2008-06-10T07:36:00.000-07:00</published><updated>2008-06-10T07:37:27.644-07:00</updated><title type='text'>Streaming SIMD Extensions (SSE)</title><content type='html'>&lt;span style="color:#ffff00;"&gt;Microsoft SpecificThis section describes the C/C++ language-level features supporting SSE. The following features of the intrinsics are explained:&lt;br /&gt;Streaming SIMD Extensions Supported by 3DNow!&lt;br /&gt;Floating-Point Intrinsics Using Streaming SIMD Extensions&lt;br /&gt;Miscellaneous Intrinsics Using Streaming SIMD Extensions&lt;br /&gt;Memory and Initialization Using Streaming SIMD Extensions&lt;br /&gt;Integer Intrinsics Using Streaming SIMD Extensions&lt;br /&gt;Cache Support Using Streaming SIMD Extensions&lt;br /&gt;In addition, the following macro functions are described:&lt;br /&gt;Macro Function for Shuffle Using Streaming SIMD Extensions&lt;br /&gt;Macro Functions to Read and Write the Control Registers&lt;br /&gt;Macro Function for Matrix Transposition&lt;br /&gt;The header file xmmintrin.h contains the declarations for the SSE intrinsics. The file fvec.h contains operator overloads for some of the SSE intrinsics, which are available for use in C++ programs.&lt;br /&gt;SSE intrinsics use the __m128, __m128i, and __m128d data types, which are not supported on Itanium Processor Family (IPF) processors. Any SSE intrinsics that use the __m64 data type are not supported on x64 processors.&lt;br /&gt;END Microsoft Specific&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-2828428495143953366?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/2828428495143953366/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=2828428495143953366' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/2828428495143953366'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/2828428495143953366'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/streaming-simd-extensions-sse.html' title='Streaming SIMD Extensions (SSE)'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-1499540259030838401</id><published>2008-06-10T07:35:00.000-07:00</published><updated>2008-06-10T07:36:04.657-07:00</updated><title type='text'>AMD 3DNow! Technology Overview and Intrinsics</title><content type='html'>&lt;span style="color:#ffff00;"&gt;Microsoft SpecificThe AMD 3DNow! technology is a group of instructions that opens the traditional processing bottlenecks for multimedia and floating-point-intensive applications. The 3DNow! technology enables faster frame rates on high-resolution scenes, much better physical modeling of real-world environments, sharper and more detailed 3D imaging, smoother video playback, and near-theater–quality audio.&lt;br /&gt;The 3DNow! technology is compatible with today's existing x86 software and requires no operating system support, allowing 3DNow! applications to work with all existing operating systems. This technology is implemented by processors from AMD beginning with AMD-K6-2, AMD-K6-III, and AMD Athlon processors.&lt;br /&gt;Beginning with the AMD Athlon processor, 3DNow! technology has been enhanced to add five new 3DNow! digital signal processing (DSP) instructions and 19 MMX Extensions, including streaming functionality.&lt;br /&gt;This overview of AMD 3DNow! technology contains the following sections:&lt;br /&gt;Key Functionality&lt;br /&gt;Feature Detection&lt;br /&gt;Register Set&lt;br /&gt;Data Types&lt;br /&gt;3DNow! Instruction Formats&lt;br /&gt;Intrinsics Overview&lt;br /&gt;Task Switching&lt;br /&gt;Exceptions&lt;br /&gt;Prefixes&lt;br /&gt;3DNow! Intrinsics&lt;br /&gt;END Microsoft Specific&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-1499540259030838401?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/1499540259030838401/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=1499540259030838401' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/1499540259030838401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/1499540259030838401'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/amd-3dnow-technology-overview-and.html' title='AMD 3DNow! Technology Overview and Intrinsics'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-2853535642031892493</id><published>2008-06-10T07:33:00.000-07:00</published><updated>2008-06-10T07:35:08.726-07:00</updated><title type='text'>Intel Overview of New Instructions and Extensions</title><content type='html'>&lt;span style="color:#ffff00;"&gt;Microsoft Specific&lt;br /&gt;The Pentium III Processor and other processors such as the Pentium processor with MMX technology and Pentium II processor have instructions to enable development of optimized multimedia applications. The instructions are implemented through extensions to previously implemented instructions. This technology uses the single-instruction, multiple-data (SIMD) technique. By processing data elements in parallel, applications with media-rich bitstreams can significantly improve performance by using SIMD instructions.&lt;br /&gt;You can access the Intel performance libraries at http://developer.intel.com/.&lt;br /&gt;The most direct way to use these instructions is to inline the assembly language instructions into your source code. However, this can be time consuming and tedious. Instead, Intel provides easy implementation by using API extension sets, referred to as intrinsics.&lt;br /&gt;Intrinsics Availability on Intel Processors&lt;br /&gt;Processors MMX technology intrinsics Streaming SIMD Extensions (SSE) Streaming SIMD Extensions 2 (SSE2) instructions Processors that support SSE2YesYesYesPentium III YesYesNot availablePentium II YesNot availableNot availablePentium with MMX technologyYesNot availableNot availablePentium Pro Not availableNot availableNot availablePentium Not availableNot availableNot available&lt;br /&gt;The following topics are covered:&lt;br /&gt;Benefits of Using Intrinsics&lt;br /&gt;Intrinsic Conventions&lt;br /&gt;Intrinsic Categories and Supporting Extensions&lt;br /&gt;END Microsoft Specific&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-2853535642031892493?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/2853535642031892493/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=2853535642031892493' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/2853535642031892493'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/2853535642031892493'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/intel-overview-of-new-instructions-and.html' title='Intel Overview of New Instructions and Extensions'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-6368944435880894407</id><published>2008-06-10T07:31:00.000-07:00</published><updated>2008-06-10T07:32:38.013-07:00</updated><title type='text'>Compiler Support for the MMX, SSE, and SSE2 Intrinsics</title><content type='html'>&lt;span style="color:#ffff00;"&gt;Microsoft SpecificTo support the use of MMX, SSE, and SSE2 intrinsics, the compiler includes the following features:&lt;br /&gt;Data alignment&lt;br /&gt;Inline assembly&lt;br /&gt;Data AlignmentPreviously, alignment issues in programs were addressed either by the compiler or directly in hardware. Also, any alignment changes needed for a program to run correctly were automatically enabled. However, with the advent of intrinsic support, the user must take a more active role to guarantee that alignment issues are appropriately addressed.&lt;br /&gt;Many of the new intrinsics have data alignment requirements. If these intrinsics are used and data is not appropriately aligned, the program will throw an exception that must be handled by the program; otherwise, the program will fault.&lt;br /&gt;The new intrinsics require aligned data to allow better performance. With the size of new registers implemented to support the new, enhanced instruction sets, new alignment requirements were defined to make the best use of recent cache architectures. Specific alignment requirements for each intrinsic can be found in the documentation for the intrinsic.&lt;br /&gt;There are different tools to specify appropriate rules for the alignment of data. For alignment of user declared variables, for example, static or automatic data, refer to the align section documentation. For data dynamically allocated from the heap, refer to the data alignment functions.&lt;br /&gt;Note The __m64, __m128, __m128i and __m128d new data types already have an alignment value.&lt;br /&gt;align&lt;br /&gt;__alignof&lt;br /&gt;Inline AssemblyThe compiler supports use of intrinsic assembly instructions in inline assembly (__asm) blocks. The compiler also accepts the new syntax MMWORD PTR and XMMWORD PTR to refer to 64- and 128-bit data.&lt;br /&gt;END Microsoft SpecificFor information on how to detect the capabilities of a CPU, see CPUID&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-6368944435880894407?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/6368944435880894407/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=6368944435880894407' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/6368944435880894407'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/6368944435880894407'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/compiler-support-for-mmx-sse-and-sse2.html' title='Compiler Support for the MMX, SSE, and SSE2 Intrinsics'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-757952537969480023</id><published>2008-06-10T07:29:00.000-07:00</published><updated>2008-06-10T07:31:00.294-07:00</updated><title type='text'>MMX, SSE, and SSE2 Intrinsics</title><content type='html'>&lt;span style="color:#ffff00;"&gt;This section discusses intrinsic support for the enhanced instruction sets supported by Intel and Advanced Micro Devices (AMD) processors.&lt;br /&gt;Microsoft SpecificCompiler Support for the MMX, SSE, and SSE2 Intrinsics&lt;br /&gt;Intel Technology Overview of New Instructions and Extensions&lt;br /&gt;AMD 3DNow! Technology Overview and Intrinsics&lt;br /&gt;MMX Technology&lt;br /&gt;Streaming SIMD Extensions (SSE)&lt;br /&gt;Streaming SIMD Extensions 2 (SSE2) Instructions&lt;br /&gt;An intrinsic is a function known by the compiler that directly maps to a sequence of one or more assembly language instructions. Intrinsic functions are inherently more efficient than called functions because no calling linkage is required.&lt;br /&gt;Intrinsics make the use of processor-specific enhancements easier because they provide a C/C++ language interface to assembly instructions. In doing so, the compiler manages things that the user would normally have to be concerned with, such as register names, register allocations, and memory locations of data.&lt;br /&gt;For information on how to detect the capabilities of a CPU, see CPUID Sample: Determines CPU Capabilities.&lt;br /&gt;All the MMX, SSE and SSE2 intrinsics are only available as intrinsics, thus, they are not affected by the setting of /Oi, and #pragma function may not be used on them.&lt;br /&gt;END Microsoft Specific&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-757952537969480023?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/757952537969480023/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=757952537969480023' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/757952537969480023'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/757952537969480023'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/mmx-sse-and-sse2-intrinsics.html' title='MMX, SSE, and SSE2 Intrinsics'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-1829493460349708616</id><published>2008-06-10T07:23:00.000-07:00</published><updated>2008-06-10T07:28:46.823-07:00</updated><title type='text'>Exception Handling in Visual C++</title><content type='html'>&lt;span style="color:#ffff00;"&gt;Robust code anticipates and handles exceptions. Exceptions occur when a program executes abnormally because of conditions outside the program's control. Certain operations, including object creation and file input/output, are subject to failures that go beyond errors. Out-of-memory conditions, for example, can occur even when your program is running correctly.&lt;br /&gt;Abnormal situations should be handled by throwing and catching exceptions. Such situations are not the same as normal error conditions, such as a function executing correctly, but returning a result code indicating an error. A normal error condition, for example, would be a file status function indicating that a file does not exist. For normal error conditions, the program should examine the error code and respond appropriately.&lt;br /&gt;Abnormal situations are also not the same as erroneous execution, in which, for example, the caller makes a mistake in passing arguments to a function or calls it in an inappropriate context. For erroneous execution, test your inputs and other assumptions with an assertion (see Using Assertions).&lt;br /&gt;Visual C++ supports three kinds of exception handling:&lt;br /&gt;C++ exception handling&lt;br /&gt;Although structured exception handling works with C and C++ source files, it is not specifically designed for C++. For C++ programs, you should use C++ exception handling.&lt;br /&gt;Structured exception handling&lt;br /&gt;Windows supplies its own exception mechanism, called SEH. It is not recommended for C++ or MFC programming. Use SEH only in non-MFC C programs.&lt;br /&gt;MFC exceptions&lt;br /&gt;Since version 3.0, MFC has used C++ exceptions but still supports its older exception handling macros, which are similar to C++ exceptions in form. The older MFC exception handling macros have been supported since version 1.0. Although these macros are not recommended for new programming, they are still supported for backward compatibility. In programs that already use the macros, you can freely use C++ exceptions as well. During preprocessing, the macros evaluate to the exception handling keywords defined in the Visual C++ implementation of the C++ language as of Visual C++ version 2.0. You can leave existing exception macros in place while you begin to use C++ exceptions.&lt;br /&gt;Do not mix the error handling mechanisms; for example, do not use C++ exceptions with SEH. For advice about mixing MFC macros and C++ exceptions, see Exceptions: Using MFC Macros and C++ Exceptions.&lt;br /&gt;For information on handling exceptions in CLR applications, see Exception Handling under /clr.&lt;br /&gt;For information about exception handling on x64 processors, see Exception Handling (x64).&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-1829493460349708616?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/1829493460349708616/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=1829493460349708616' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/1829493460349708616'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/1829493460349708616'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/exception-handling-in-visual-c.html' title='Exception Handling in Visual C++'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-4259697884865388151</id><published>2008-06-10T07:18:00.000-07:00</published><updated>2008-06-10T07:23:26.581-07:00</updated><title type='text'>Calling Conventions</title><content type='html'>&lt;span style="color:#ffff00;"&gt;This section describes the process that one function (caller) makes call into another function (callee).&lt;br /&gt;For prototyped functions, all arguments are converted to the expected callee types before passing.&lt;br /&gt;Parameter Passing&lt;br /&gt;Varargs&lt;br /&gt;Unprototyped Functions&lt;br /&gt;Return Values&lt;br /&gt;Caller/Callee Saved Registers&lt;br /&gt;Function Pointers&lt;br /&gt;Legacy Floating-Point Support&lt;br /&gt;FpCsr&lt;br /&gt;MXCSR&lt;br /&gt;setjmp/longjump&lt;br /&gt;The Visual C/C++ compiler provides several different conventions for calling internal and external functions. Understanding these different approaches can help you debug your program and link your code with assembly-language routines.&lt;br /&gt;The topics on this subject explain the differences between the calling conventions, how arguments are passed, and how values are returned by functions. They also discuss naked function calls, an advanced feature that enables you to write your own prolog and epilog code.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-4259697884865388151?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/4259697884865388151/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=4259697884865388151' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/4259697884865388151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/4259697884865388151'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/calling-conventions.html' title='Calling Conventions'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-1628198798648446523</id><published>2008-06-10T06:22:00.000-07:00</published><updated>2008-06-10T06:28:21.883-07:00</updated><title type='text'>Create Directory</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_MeJernKB7_c/SE6A9Rn5RrI/AAAAAAAAAUo/e01AEqdl2mc/s1600-h/Create+Directory.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210243609105352370" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_MeJernKB7_c/SE6A9Rn5RrI/AAAAAAAAAUo/e01AEqdl2mc/s320/Create+Directory.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My57 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;using namespace System::IO;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::Button^ BtnCreateDirectory;&lt;br /&gt;private: System::Windows::Forms::TextBox^ txtDirectoryName;&lt;br /&gt;protected:&lt;br /&gt;private: System::Windows::Forms::Label^ lbl;&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;BtnCreateDirectory = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;txtDirectoryName = (gcnew System::Windows::Forms::TextBox());&lt;br /&gt;this-&gt;lbl = (gcnew System::Windows::Forms::Label());&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// BtnCreateDirectory&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnCreateDirectory-&gt;BackColor = System::Drawing::Color::FromArgb(static_cast&lt;/span&gt;&lt;system::int32&gt;&lt;span style="color:#ffffff;"&gt;(static_cast&lt;/span&gt;&lt;system::byte&gt;&lt;span style="color:#ffffff;"&gt;(64)),&lt;br /&gt;static_cast&lt;/span&gt;&lt;system::int32&gt;&lt;span style="color:#ffffff;"&gt;(static_cast&lt;/span&gt;&lt;system::byte&gt;&lt;span style="color:#ffffff;"&gt;(0)), static_cast&lt;/span&gt;&lt;system::int32&gt;&lt;span style="color:#ffffff;"&gt;(static_cast&lt;/span&gt;&lt;system::byte&gt;&lt;span style="color:#ffffff;"&gt;(64)));&lt;br /&gt;this-&gt;BtnCreateDirectory-&gt;Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,&lt;br /&gt;static_cast&lt;/span&gt;&lt;system::byte&gt;&lt;span style="color:#ffffff;"&gt;(222)));&lt;br /&gt;this-&gt;BtnCreateDirectory-&gt;ForeColor = System::Drawing::Color::White;&lt;br /&gt;this-&gt;BtnCreateDirectory-&gt;Location = System::Drawing::Point(11, 88);&lt;br /&gt;this-&gt;BtnCreateDirectory-&gt;Name = L"BtnCreateDirectory";&lt;br /&gt;this-&gt;BtnCreateDirectory-&gt;Size = System::Drawing::Size(266, 94);&lt;br /&gt;this-&gt;BtnCreateDirectory-&gt;TabIndex = 0;&lt;br /&gt;this-&gt;BtnCreateDirectory-&gt;Text = L"Create Directory";&lt;br /&gt;this-&gt;BtnCreateDirectory-&gt;UseVisualStyleBackColor = false;&lt;br /&gt;this-&gt;BtnCreateDirectory-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnCreateDirectory_Click);&lt;br /&gt;//&lt;br /&gt;// txtDirectoryName&lt;br /&gt;//&lt;br /&gt;this-&gt;txtDirectoryName-&gt;BackColor = System::Drawing::Color::FromArgb(static_cast&lt;/span&gt;&lt;system::int32&gt;&lt;span style="color:#ffffff;"&gt;(static_cast&lt;/span&gt;&lt;system::byte&gt;&lt;span style="color:#ffffff;"&gt;(255)),&lt;br /&gt;static_cast&lt;/span&gt;&lt;system::int32&gt;&lt;span style="color:#ffffff;"&gt;(static_cast&lt;/span&gt;&lt;system::byte&gt;&lt;span style="color:#ffffff;"&gt;(255)), static_cast&lt;/span&gt;&lt;system::int32&gt;&lt;span style="color:#ffffff;"&gt;(static_cast&lt;/span&gt;&lt;system::byte&gt;&lt;span style="color:#ffffff;"&gt;(128)));&lt;br /&gt;this-&gt;txtDirectoryName-&gt;ForeColor = System::Drawing::Color::Blue;&lt;br /&gt;this-&gt;txtDirectoryName-&gt;Location = System::Drawing::Point(21, 48);&lt;br /&gt;this-&gt;txtDirectoryName-&gt;Name = L"txtDirectoryName";&lt;br /&gt;this-&gt;txtDirectoryName-&gt;Size = System::Drawing::Size(256, 20);&lt;br /&gt;this-&gt;txtDirectoryName-&gt;TabIndex = 1;&lt;br /&gt;//&lt;br /&gt;// lbl&lt;br /&gt;//&lt;br /&gt;this-&gt;lbl-&gt;AutoSize = true;&lt;br /&gt;this-&gt;lbl-&gt;ForeColor = System::Drawing::Color::Yellow;&lt;br /&gt;this-&gt;lbl-&gt;Location = System::Drawing::Point(17, 16);&lt;br /&gt;this-&gt;lbl-&gt;Name = L"lbl";&lt;br /&gt;this-&gt;lbl-&gt;Size = System::Drawing::Size(89, 13);&lt;br /&gt;this-&gt;lbl-&gt;TabIndex = 2;&lt;br /&gt;this-&gt;lbl-&gt;Text = L"Directory Name : ";&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;BackColor = System::Drawing::Color::FromArgb(static_cast&lt;/span&gt;&lt;system::int32&gt;&lt;span style="color:#ffffff;"&gt;(static_cast&lt;/span&gt;&lt;system::byte&gt;&lt;span style="color:#ffffff;"&gt;(255)), static_cast&lt;/span&gt;&lt;system::int32&gt;&lt;span style="color:#ffffff;"&gt;(static_cast&lt;/span&gt;&lt;system::byte&gt;&lt;span style="color:#ffffff;"&gt;(128)),&lt;br /&gt;static_cast&lt;/span&gt;&lt;system::int32&gt;&lt;span style="color:#ffffff;"&gt;(static_cast&lt;/span&gt;&lt;system::byte&gt;&lt;span style="color:#ffffff;"&gt;(128)));&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(292, 197);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;lbl);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;txtDirectoryName);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnCreateDirectory);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;this-&gt;PerformLayout();&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Create Directory&lt;br /&gt;private: System::Void BtnCreateDirectory_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;if(txtDirectoryName-&gt;Text!="")&lt;br /&gt;{&lt;br /&gt;Directory::CreateDirectory("C:\\"+txtDirectoryName-&gt;Text);&lt;br /&gt;MessageBox::Show("Create Directory Completed");&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/system::byte&gt;&lt;/system::int32&gt;&lt;/system::byte&gt;&lt;/system::int32&gt;&lt;/system::byte&gt;&lt;/system::int32&gt;&lt;/system::byte&gt;&lt;/system::int32&gt;&lt;/system::byte&gt;&lt;/system::int32&gt;&lt;/system::byte&gt;&lt;/system::int32&gt;&lt;/system::byte&gt;&lt;/system::byte&gt;&lt;/system::int32&gt;&lt;/system::byte&gt;&lt;/system::int32&gt;&lt;/system::byte&gt;&lt;/system::int32&gt;&lt;br /&gt;&lt;?XML:NAMESPACE PREFIX = System /&gt;&lt;system::int32&gt;&lt;system::byte&gt;&lt;system::int32&gt;&lt;system::byte&gt;&lt;system::int32&gt;&lt;system::byte&gt;&lt;system::byte&gt;&lt;system::int32&gt;&lt;system::byte&gt;&lt;system::int32&gt;&lt;system::byte&gt;&lt;system::int32&gt;&lt;system::byte&gt;&lt;system::int32&gt;&lt;system::byte&gt;&lt;system::int32&gt;&lt;system::byte&gt;&lt;system::int32&gt;&lt;system::byte&gt;&lt;/system::byte&gt;&lt;/system::int32&gt;&lt;/system::byte&gt;&lt;/system::int32&gt;&lt;/system::byte&gt;&lt;/system::int32&gt;&lt;/system::byte&gt;&lt;/system::int32&gt;&lt;/system::byte&gt;&lt;/system::int32&gt;&lt;/system::byte&gt;&lt;/system::int32&gt;&lt;/system::byte&gt;&lt;/system::byte&gt;&lt;/system::int32&gt;&lt;/system::byte&gt;&lt;/system::int32&gt;&lt;/system::byte&gt;&lt;/system::int32&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-1628198798648446523?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/1628198798648446523/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=1628198798648446523' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/1628198798648446523'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/1628198798648446523'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/create-directory.html' title='Create Directory'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_MeJernKB7_c/SE6A9Rn5RrI/AAAAAAAAAUo/e01AEqdl2mc/s72-c/Create+Directory.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-560443092485013848</id><published>2008-06-09T23:49:00.001-07:00</published><updated>2008-06-09T23:51:39.408-07:00</updated><title type='text'>Scroll Form</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_MeJernKB7_c/SE4kX-3MepI/AAAAAAAAAUY/sihTDMb7XRs/s1600-h/Scroll+Form.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210141813344336530" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_MeJernKB7_c/SE4kX-3MepI/AAAAAAAAAUY/sihTDMb7XRs/s320/Scroll+Form.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My56 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::Button^ BtnScrollForm;&lt;br /&gt;private: System::Windows::Forms::PictureBox^ PctImage;&lt;br /&gt;protected:&lt;br /&gt;protected:&lt;br /&gt;protected:&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));&lt;br /&gt;this-&gt;BtnScrollForm = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;PctImage = (gcnew System::Windows::Forms::PictureBox());&lt;br /&gt;(cli::safe_cast&lt;/span&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;span style="color:#ffffff;"&gt;(this-&gt;PctImage))-&gt;BeginInit();&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// BtnScrollForm&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnScrollForm-&gt;Location = System::Drawing::Point(12, 12);&lt;br /&gt;this-&gt;BtnScrollForm-&gt;Name = L"BtnScrollForm";&lt;br /&gt;this-&gt;BtnScrollForm-&gt;Size = System::Drawing::Size(332, 45);&lt;br /&gt;this-&gt;BtnScrollForm-&gt;TabIndex = 0;&lt;br /&gt;this-&gt;BtnScrollForm-&gt;Text = L"Scroll Form";&lt;br /&gt;this-&gt;BtnScrollForm-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnScrollForm-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnScrollForm_Click);&lt;br /&gt;//&lt;br /&gt;// PctImage&lt;br /&gt;//&lt;br /&gt;this-&gt;PctImage-&gt;Image = (cli::safe_cast&lt;/span&gt;&lt;system::drawing::image^&gt;&lt;span style="color:#ffffff;"&gt;(resources-&gt;GetObject(L"PctImage.Image")));&lt;br /&gt;this-&gt;PctImage-&gt;Location = System::Drawing::Point(13, 73);&lt;br /&gt;this-&gt;PctImage-&gt;Name = L"PctImage";&lt;br /&gt;this-&gt;PctImage-&gt;Size = System::Drawing::Size(715, 344);&lt;br /&gt;this-&gt;PctImage-&gt;TabIndex = 1;&lt;br /&gt;this-&gt;PctImage-&gt;TabStop = false;&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(357, 125);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;PctImage);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnScrollForm);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;(cli::safe_cast&lt;/span&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;span style="color:#ffffff;"&gt;(this-&gt;PctImage))-&gt;EndInit();&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Scroll Form&lt;br /&gt;private: System::Void BtnScrollForm_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;AutoScroll=true;&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;Text="Scroll Form";&lt;br /&gt;this-&gt;BackColor=Color::AliceBlue;&lt;br /&gt;this-&gt;MaximizeBox=false;&lt;br /&gt;BtnScrollForm-&gt;BackColor=Color::Black;&lt;br /&gt;BtnScrollForm-&gt;ForeColor=Color::White;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;/system::drawing::image^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;br /&gt;&lt;?XML:NAMESPACE PREFIX = System /&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;system::drawing::image^&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;/system::drawing::image^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-560443092485013848?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/560443092485013848/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=560443092485013848' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/560443092485013848'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/560443092485013848'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/scroll-form.html' title='Scroll Form'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_MeJernKB7_c/SE4kX-3MepI/AAAAAAAAAUY/sihTDMb7XRs/s72-c/Scroll+Form.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-2015253105973245811</id><published>2008-06-09T23:30:00.000-07:00</published><updated>2008-06-09T23:39:57.638-07:00</updated><title type='text'>Region Form</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_MeJernKB7_c/SE4hUKJvUkI/AAAAAAAAAUQ/JJHpX8aNOO4/s1600-h/Region+Form.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210138449120547394" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_MeJernKB7_c/SE4hUKJvUkI/AAAAAAAAAUQ/JJHpX8aNOO4/s320/Region+Form.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My55 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(292, 266);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;DoubleClick += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_DoubleClick);&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Region Form&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;FormBorderStyle=Windows::Forms::FormBorderStyle::None;&lt;br /&gt;this-&gt;BackgroundImageLayout=Windows::Forms::ImageLayout::Stretch;&lt;br /&gt;this-&gt;BackgroundImage=Image::FromFile("C:\\Character.BMP");&lt;br /&gt;this-&gt;TransparencyKey=Color::Black;&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_DoubleClick(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;Close();&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-2015253105973245811?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/2015253105973245811/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=2015253105973245811' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/2015253105973245811'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/2015253105973245811'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/region-form.html' title='Region Form'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_MeJernKB7_c/SE4hUKJvUkI/AAAAAAAAAUQ/JJHpX8aNOO4/s72-c/Region+Form.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-1250353294171248205</id><published>2008-06-09T23:17:00.000-07:00</published><updated>2008-06-09T23:27:59.415-07:00</updated><title type='text'>Return Value in Function</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_MeJernKB7_c/SE4esCLyFlI/AAAAAAAAAUI/5j7G3b5EwZY/s1600-h/Return+Value+In+Function.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210135560763610706" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_MeJernKB7_c/SE4esCLyFlI/AAAAAAAAAUI/5j7G3b5EwZY/s320/Return+Value+In+Function.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My54 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::Button^ BtnReturn;&lt;br /&gt;private: System::Windows::Forms::Label^ lblReturnValue;&lt;br /&gt;protected:&lt;br /&gt;protected:&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;BtnReturn = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;lblReturnValue = (gcnew System::Windows::Forms::Label());&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// BtnReturn&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnReturn-&gt;BackColor = System::Drawing::Color::FromArgb(static_cast&lt;/span&gt;&lt;system::int32&gt;&lt;span style="color:#ffffff;"&gt;(static_cast&lt;/span&gt;&lt;system::byte&gt;&lt;span style="color:#ffffff;"&gt;(64)), static_cast&lt;/span&gt;&lt;system::int32&gt;&lt;span style="color:#ffffff;"&gt;(static_cast&lt;/span&gt;&lt;system::byte&gt;&lt;span style="color:#ffffff;"&gt;(0)),&lt;br /&gt;static_cast&lt;/span&gt;&lt;system::int32&gt;&lt;span style="color:#ffffff;"&gt;(static_cast&lt;/span&gt;&lt;system::byte&gt;&lt;span style="color:#ffffff;"&gt;(64)));&lt;br /&gt;this-&gt;BtnReturn-&gt;Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 14.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,&lt;br /&gt;static_cast&lt;/span&gt;&lt;system::byte&gt;&lt;span style="color:#ffffff;"&gt;(222)));&lt;br /&gt;this-&gt;BtnReturn-&gt;ForeColor = System::Drawing::Color::White;&lt;br /&gt;this-&gt;BtnReturn-&gt;Location = System::Drawing::Point(12, 66);&lt;br /&gt;this-&gt;BtnReturn-&gt;Name = L"BtnReturn";&lt;br /&gt;this-&gt;BtnReturn-&gt;Size = System::Drawing::Size(268, 63);&lt;br /&gt;this-&gt;BtnReturn-&gt;TabIndex = 0;&lt;br /&gt;this-&gt;BtnReturn-&gt;Text = L"Return Value";&lt;br /&gt;this-&gt;BtnReturn-&gt;UseVisualStyleBackColor = false;&lt;br /&gt;this-&gt;BtnReturn-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnReturn_Click);&lt;br /&gt;//&lt;br /&gt;// lblReturnValue&lt;br /&gt;//&lt;br /&gt;this-&gt;lblReturnValue-&gt;AutoSize = true;&lt;br /&gt;this-&gt;lblReturnValue-&gt;Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 11.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,&lt;br /&gt;static_cast&lt;/span&gt;&lt;system::byte&gt;&lt;span style="color:#ffffff;"&gt;(222)));&lt;br /&gt;this-&gt;lblReturnValue-&gt;ForeColor = System::Drawing::Color::Yellow;&lt;br /&gt;this-&gt;lblReturnValue-&gt;Location = System::Drawing::Point(12, 25);&lt;br /&gt;this-&gt;lblReturnValue-&gt;Name = L"lblReturnValue";&lt;br /&gt;this-&gt;lblReturnValue-&gt;Size = System::Drawing::Size(114, 18);&lt;br /&gt;this-&gt;lblReturnValue-&gt;TabIndex = 2;&lt;br /&gt;this-&gt;lblReturnValue-&gt;Text = L"Return Value :";&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;BackColor = System::Drawing::SystemColors::ControlDark;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(292, 142);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;lblReturnValue);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnReturn);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Return Value In Function";&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;this-&gt;PerformLayout();&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Return Value in Function&lt;br /&gt;int Ch_X;&lt;br /&gt;int MoveX(int Step)&lt;br /&gt;{&lt;br /&gt;Ch_X+=Step;&lt;br /&gt;return Ch_X;&lt;br /&gt;}&lt;br /&gt;private: System::Void BtnReturn_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;lblReturnValue-&gt;Text="Return Value : "+MoveX(2);&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/system::byte&gt;&lt;/system::byte&gt;&lt;/system::byte&gt;&lt;/system::int32&gt;&lt;/system::byte&gt;&lt;/system::int32&gt;&lt;/system::byte&gt;&lt;/system::int32&gt;&lt;br /&gt;&lt;?XML:NAMESPACE PREFIX = System /&gt;&lt;system::int32&gt;&lt;system::byte&gt;&lt;system::int32&gt;&lt;system::byte&gt;&lt;system::int32&gt;&lt;system::byte&gt;&lt;system::byte&gt;&lt;system::byte&gt;&lt;/system::byte&gt;&lt;/system::byte&gt;&lt;/system::byte&gt;&lt;/system::int32&gt;&lt;/system::byte&gt;&lt;/system::int32&gt;&lt;/system::byte&gt;&lt;/system::int32&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-1250353294171248205?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/1250353294171248205/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=1250353294171248205' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/1250353294171248205'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/1250353294171248205'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/return-value-in-function.html' title='Return Value in Function'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_MeJernKB7_c/SE4esCLyFlI/AAAAAAAAAUI/5j7G3b5EwZY/s72-c/Return+Value+In+Function.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-7583396855015014258</id><published>2008-06-09T23:03:00.000-07:00</published><updated>2008-06-09T23:17:09.254-07:00</updated><title type='text'>Property Count In ListBox</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_MeJernKB7_c/SE4cTEriCOI/AAAAAAAAAUA/W27yJCa_zy4/s1600-h/Property+Count+In+ListBox.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210132932913662178" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_MeJernKB7_c/SE4cTEriCOI/AAAAAAAAAUA/W27yJCa_zy4/s320/Property+Count+In+ListBox.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My53 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::Button^ Btn;&lt;br /&gt;private: System::Windows::Forms::ComboBox^ Cmb;&lt;br /&gt;protected:&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;Btn = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;Cmb = (gcnew System::Windows::Forms::ComboBox());&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// Btn&lt;br /&gt;//&lt;br /&gt;this-&gt;Btn-&gt;Location = System::Drawing::Point(12, 73);&lt;br /&gt;this-&gt;Btn-&gt;Name = L"Btn";&lt;br /&gt;this-&gt;Btn-&gt;Size = System::Drawing::Size(268, 50);&lt;br /&gt;this-&gt;Btn-&gt;TabIndex = 0;&lt;br /&gt;this-&gt;Btn-&gt;Text = L"Show Count Items ";&lt;br /&gt;this-&gt;Btn-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;Btn-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::Btn_Click);&lt;br /&gt;//&lt;br /&gt;// Cmb&lt;br /&gt;//&lt;br /&gt;this-&gt;Cmb-&gt;FormattingEnabled = true;&lt;br /&gt;this-&gt;Cmb-&gt;Location = System::Drawing::Point(12, 28);&lt;br /&gt;this-&gt;Cmb-&gt;Name = L"Cmb";&lt;br /&gt;this-&gt;Cmb-&gt;Size = System::Drawing::Size(268, 21);&lt;br /&gt;this-&gt;Cmb-&gt;TabIndex = 1;&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(292, 134);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;Cmb);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;Btn);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregio&lt;br /&gt;//Property Count In ListBox&lt;br /&gt;private: System::Void Btn_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;int i;&lt;br /&gt;String^str;&lt;br /&gt;str="www.cplusplussourcecode.blogspot.com";&lt;br /&gt;for(i=0;i&lt;=str-&gt;Length;i++)&lt;br /&gt;{&lt;br /&gt;Cmb-&gt;Items-&gt;Add(str);&lt;br /&gt;}&lt;br /&gt;this-&gt;Text=Cmb-&gt;Items-&gt;Count.ToString();&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;BackColor=Color::Blue;&lt;br /&gt;this-&gt;Text="Property Count In ListBox";&lt;br /&gt;this-&gt;MaximizeBox=false;&lt;br /&gt;Cmb-&gt;BackColor=Color::Red;&lt;br /&gt;Cmb-&gt;ForeColor=Color::White;&lt;br /&gt;Btn-&gt;BackColor=Color::Black;&lt;br /&gt;Btn-&gt;ForeColor=Color::White;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-7583396855015014258?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/7583396855015014258/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=7583396855015014258' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/7583396855015014258'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/7583396855015014258'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/property-count-in-listbox.html' title='Property Count In ListBox'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_MeJernKB7_c/SE4cTEriCOI/AAAAAAAAAUA/W27yJCa_zy4/s72-c/Property+Count+In+ListBox.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-1265248183514632894</id><published>2008-06-09T22:59:00.000-07:00</published><updated>2008-06-09T23:02:00.806-07:00</updated><title type='text'>Using for Add Items in ListBox</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_MeJernKB7_c/SE4YlDHDbPI/AAAAAAAAAT4/t-6KJprFkkg/s1600-h/Using+for+Add+Items+in+ListBox.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210128843683359986" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_MeJernKB7_c/SE4YlDHDbPI/AAAAAAAAAT4/t-6KJprFkkg/s320/Using+for+Add+Items+in+ListBox.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My52 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::Button^ BtnAddItems;&lt;br /&gt;protected:&lt;br /&gt;private: System::Windows::Forms::ListBox^ lst;&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;BtnAddItems = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;lst = (gcnew System::Windows::Forms::ListBox());&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// BtnAddItems&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnAddItems-&gt;Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,&lt;br /&gt;static_cast&lt;/span&gt;&lt;system::byte&gt;&lt;span style="color:#ffffff;"&gt;(222)));&lt;br /&gt;this-&gt;BtnAddItems-&gt;Location = System::Drawing::Point(12, 149);&lt;br /&gt;this-&gt;BtnAddItems-&gt;Name = L"BtnAddItems";&lt;br /&gt;this-&gt;BtnAddItems-&gt;Size = System::Drawing::Size(377, 42);&lt;br /&gt;this-&gt;BtnAddItems-&gt;TabIndex = 0;&lt;br /&gt;this-&gt;BtnAddItems-&gt;Text = L"Add Items";&lt;br /&gt;this-&gt;BtnAddItems-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnAddItems-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnAddItems_Click);&lt;br /&gt;//&lt;br /&gt;// lst&lt;br /&gt;//&lt;br /&gt;this-&gt;lst-&gt;Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 15.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,&lt;br /&gt;static_cast&lt;/span&gt;&lt;system::byte&gt;&lt;span style="color:#ffffff;"&gt;(222)));&lt;br /&gt;this-&gt;lst-&gt;FormattingEnabled = true;&lt;br /&gt;this-&gt;lst-&gt;ItemHeight = 25;&lt;br /&gt;this-&gt;lst-&gt;Location = System::Drawing::Point(14, 19);&lt;br /&gt;this-&gt;lst-&gt;Name = L"lst";&lt;br /&gt;this-&gt;lst-&gt;Size = System::Drawing::Size(375, 104);&lt;br /&gt;this-&gt;lst-&gt;TabIndex = 1;&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(401, 203);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;lst);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnAddItems);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Using for Add Items in ListBox&lt;br /&gt;private: System::Void BtnAddItems_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;int i;&lt;br /&gt;for(i=0;i&lt;=50;i++) { lst-&gt;Items-&gt;Add("Index : "+i);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;BackColor=Color::Red;&lt;br /&gt;this-&gt;Text="Using for Add Items in ListBox";&lt;br /&gt;this-&gt;MaximizeBox=false;&lt;br /&gt;lst-&gt;BackColor=Color::Yellow;&lt;br /&gt;lst-&gt;ForeColor=Color::Red;&lt;br /&gt;BtnAddItems-&gt;BackColor=Color::Black;&lt;br /&gt;BtnAddItems-&gt;ForeColor=Color::White;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/system::byte&gt;&lt;/system::byte&gt;&lt;br /&gt;&lt;?XML:NAMESPACE PREFIX = System /&gt;&lt;system::byte&gt;&lt;system::byte&gt;&lt;/system::byte&gt;&lt;/system::byte&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-1265248183514632894?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/1265248183514632894/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=1265248183514632894' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/1265248183514632894'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/1265248183514632894'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/using-for-add-items-in-listbox.html' title='Using for Add Items in ListBox'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_MeJernKB7_c/SE4YlDHDbPI/AAAAAAAAAT4/t-6KJprFkkg/s72-c/Using+for+Add+Items+in+ListBox.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-2480176414791484727</id><published>2008-06-09T20:35:00.000-07:00</published><updated>2008-06-09T20:38:10.175-07:00</updated><title type='text'>Select Items in ComboBox</title><content type='html'>&lt;a href="http://2.bp.blogspot.com/_MeJernKB7_c/SE323t9k3hI/AAAAAAAAATw/jTlpVgnLBCE/s1600-h/Select+Items+in+ComboBox.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210091781028634130" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_MeJernKB7_c/SE323t9k3hI/AAAAAAAAATw/jTlpVgnLBCE/s320/Select+Items+in+ComboBox.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My51 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::ComboBox^ Cmb;&lt;br /&gt;protected:&lt;br /&gt;protected:&lt;br /&gt;protected:&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;Cmb = (gcnew System::Windows::Forms::ComboBox());&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// Cmb&lt;br /&gt;//&lt;br /&gt;this-&gt;Cmb-&gt;FormattingEnabled = true;&lt;br /&gt;this-&gt;Cmb-&gt;Location = System::Drawing::Point(12, 12);&lt;br /&gt;this-&gt;Cmb-&gt;Name = L"Cmb";&lt;br /&gt;this-&gt;Cmb-&gt;Size = System::Drawing::Size(268, 21);&lt;br /&gt;this-&gt;Cmb-&gt;TabIndex = 1;&lt;br /&gt;this-&gt;Cmb-&gt;SelectedIndexChanged += gcnew System::EventHandler(this, &amp;amp;Form1::Cmb_SelectedIndexChanged);&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(292, 47);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;Cmb);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Select Items in ComboBox&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;Cmb-&gt;Items-&gt;Add("Items 1");&lt;br /&gt;Cmb-&gt;Items-&gt;Add("Items 2");&lt;br /&gt;Cmb-&gt;Items-&gt;Add("Items 3");&lt;br /&gt;Cmb-&gt;Items-&gt;Add("Items 4");&lt;br /&gt;this-&gt;Text="Select Items in ComboBox";&lt;br /&gt;this-&gt;MaximizeBox=false;&lt;br /&gt;this-&gt;BackColor=Color::Plum;&lt;br /&gt;Cmb-&gt;BackColor=Color::Yellow;&lt;br /&gt;Cmb-&gt;ForeColor=Color::Blue;&lt;br /&gt;}&lt;br /&gt;private: System::Void Cmb_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;Text=Cmb-&gt;Text;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-2480176414791484727?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/2480176414791484727/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=2480176414791484727' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/2480176414791484727'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/2480176414791484727'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/select-items-in-combobox.html' title='Select Items in ComboBox'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_MeJernKB7_c/SE323t9k3hI/AAAAAAAAATw/jTlpVgnLBCE/s72-c/Select+Items+in+ComboBox.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-7754948327537339291</id><published>2008-06-09T20:33:00.000-07:00</published><updated>2008-06-09T20:35:25.358-07:00</updated><title type='text'>Show FolderBrowserDialog</title><content type='html'>&lt;a href="http://2.bp.blogspot.com/_MeJernKB7_c/SE32XHWujfI/AAAAAAAAATo/us31g9qkAY0/s1600-h/Show+FolderBrowserDialog.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210091220909329906" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_MeJernKB7_c/SE32XHWujfI/AAAAAAAAATo/us31g9qkAY0/s320/Show+FolderBrowserDialog.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My50 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::FolderBrowserDialog^ FolderBrowserDialog;&lt;br /&gt;private: System::Windows::Forms::Button^ BtnShowFolderBrowserDialog;&lt;br /&gt;protected:&lt;br /&gt;protected:&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;FolderBrowserDialog = (gcnew System::Windows::Forms::FolderBrowserDialog());&lt;br /&gt;this-&gt;BtnShowFolderBrowserDialog = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// BtnShowFolderBrowserDialog&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnShowFolderBrowserDialog-&gt;Location = System::Drawing::Point(12, 14);&lt;br /&gt;this-&gt;BtnShowFolderBrowserDialog-&gt;Name = L"BtnShowFolderBrowserDialog";&lt;br /&gt;this-&gt;BtnShowFolderBrowserDialog-&gt;Size = System::Drawing::Size(240, 42);&lt;br /&gt;this-&gt;BtnShowFolderBrowserDialog-&gt;TabIndex = 0;&lt;br /&gt;this-&gt;BtnShowFolderBrowserDialog-&gt;Text = L"Show FolderBrowserDialog";&lt;br /&gt;this-&gt;BtnShowFolderBrowserDialog-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnShowFolderBrowserDialog-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnShowFolderBrowserDialog_Click);&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(263, 68);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnShowFolderBrowserDialog);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Show FolderBrowserDialog&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;Text="Show FolderBrowesDialog";&lt;br /&gt;this-&gt;BackColor=Color::Pink;&lt;br /&gt;this-&gt;MaximizeBox=false;&lt;br /&gt;BtnShowFolderBrowserDialog-&gt;BackColor=Color::Black;&lt;br /&gt;BtnShowFolderBrowserDialog-&gt;ForeColor=Color::White;&lt;br /&gt;}&lt;br /&gt;private: System::Void BtnShowFolderBrowserDialog_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;FolderBrowserDialog-&gt;RootFolder=Environment::SpecialFolder::MyDocuments;&lt;br /&gt;FolderBrowserDialog-&gt;ShowDialog();&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-7754948327537339291?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/7754948327537339291/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=7754948327537339291' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/7754948327537339291'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/7754948327537339291'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/show-folderbrowserdialog.html' title='Show FolderBrowserDialog'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_MeJernKB7_c/SE32XHWujfI/AAAAAAAAATo/us31g9qkAY0/s72-c/Show+FolderBrowserDialog.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-2138654069070608226</id><published>2008-06-09T20:32:00.001-07:00</published><updated>2008-06-09T20:33:39.221-07:00</updated><title type='text'>GetCreateTime File</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_MeJernKB7_c/SE3163MF4ZI/AAAAAAAAATg/ULhoZBLgp-c/s1600-h/GetCreateTime+File.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210090735533416850" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_MeJernKB7_c/SE3163MF4ZI/AAAAAAAAATg/ULhoZBLgp-c/s320/GetCreateTime+File.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My49 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;using namespace System::IO;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::Label^ lblCreateTime;&lt;br /&gt;protected:&lt;br /&gt;private: System::Windows::Forms::Label^ lblPathFile;&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;lblCreateTime = (gcnew System::Windows::Forms::Label());&lt;br /&gt;this-&gt;lblPathFile = (gcnew System::Windows::Forms::Label());&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// lblCreateTime&lt;br /&gt;//&lt;br /&gt;this-&gt;lblCreateTime-&gt;AutoSize = true;&lt;br /&gt;this-&gt;lblCreateTime-&gt;Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,&lt;br /&gt;static_cast&lt;/span&gt;&lt;system::byte&gt;&lt;span style="color:#ffffff;"&gt;(222)));&lt;br /&gt;this-&gt;lblCreateTime-&gt;ForeColor = System::Drawing::Color::White;&lt;br /&gt;this-&gt;lblCreateTime-&gt;Location = System::Drawing::Point(12, 41);&lt;br /&gt;this-&gt;lblCreateTime-&gt;Name = L"lblCreateTime";&lt;br /&gt;this-&gt;lblCreateTime-&gt;Size = System::Drawing::Size(97, 16);&lt;br /&gt;this-&gt;lblCreateTime-&gt;TabIndex = 0;&lt;br /&gt;this-&gt;lblCreateTime-&gt;Text = L"CreateTime :";&lt;br /&gt;//&lt;br /&gt;// lblPathFile&lt;br /&gt;//&lt;br /&gt;this-&gt;lblPathFile-&gt;AutoSize = true;&lt;br /&gt;this-&gt;lblPathFile-&gt;Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,&lt;br /&gt;static_cast&lt;/span&gt;&lt;system::byte&gt;&lt;span style="color:#ffffff;"&gt;(222)));&lt;br /&gt;this-&gt;lblPathFile-&gt;ForeColor = System::Drawing::Color::White;&lt;br /&gt;this-&gt;lblPathFile-&gt;Location = System::Drawing::Point(12, 9);&lt;br /&gt;this-&gt;lblPathFile-&gt;Name = L"lblPathFile";&lt;br /&gt;this-&gt;lblPathFile-&gt;Size = System::Drawing::Size(77, 16);&lt;br /&gt;this-&gt;lblPathFile-&gt;TabIndex = 1;&lt;br /&gt;this-&gt;lblPathFile-&gt;Text = L"Path File :";&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(553, 64);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;lblPathFile);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;lblCreateTime);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;this-&gt;PerformLayout();&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//GetCreateTime File&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;lblCreateTime-&gt;Text="Create Time : "+File::GetCreationTime("C:\\Flower.BMP").ToString();&lt;br /&gt;lblPathFile-&gt;Text="Path File : C:\\Flower.BMP";&lt;br /&gt;this-&gt;Text="GetCreateTime File";&lt;br /&gt;this-&gt;BackColor=Color::RosyBrown;&lt;br /&gt;this-&gt;MaximizeBox=false;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/system::byte&gt;&lt;/system::byte&gt;&lt;?XML:NAMESPACE PREFIX = System /&gt;&lt;system::byte&gt;&lt;system::byte&gt;&lt;/system::byte&gt;&lt;/system::byte&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-2138654069070608226?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/2138654069070608226/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=2138654069070608226' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/2138654069070608226'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/2138654069070608226'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/getcreatetime-file.html' title='GetCreateTime File'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_MeJernKB7_c/SE3163MF4ZI/AAAAAAAAATg/ULhoZBLgp-c/s72-c/GetCreateTime+File.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-33261003506887956</id><published>2008-06-09T20:30:00.001-07:00</published><updated>2008-06-09T20:31:38.039-07:00</updated><title type='text'>Play Sound</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_MeJernKB7_c/SE31f6mxfjI/AAAAAAAAATY/tpNLY5im7W8/s1600-h/Play+Sound.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210090272594165298" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_MeJernKB7_c/SE31f6mxfjI/AAAAAAAAATY/tpNLY5im7W8/s320/Play+Sound.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My48 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: AxWMPLib::AxWindowsMediaPlayer^ w;&lt;br /&gt;protected:&lt;br /&gt;private: System::Windows::Forms::Button^ BtnPlay;&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));&lt;br /&gt;this-&gt;w = (gcnew AxWMPLib::AxWindowsMediaPlayer());&lt;br /&gt;this-&gt;BtnPlay = (gcnew System::Windows::Forms::Button());&lt;br /&gt;(cli::safe_cast&lt;/span&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;span style="color:#ffffff;"&gt;(this-&gt;w))-&gt;BeginInit();&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// w&lt;br /&gt;//&lt;br /&gt;this-&gt;w-&gt;Enabled = true;&lt;br /&gt;this-&gt;w-&gt;Location = System::Drawing::Point(11, 13);&lt;br /&gt;this-&gt;w-&gt;Name = L"w";&lt;br /&gt;this-&gt;w-&gt;OcxState = (cli::safe_cast&lt;/span&gt;&lt;system::windows::forms::axhost::state^&gt;&lt;span style="color:#ffffff;"&gt;(resources-&gt;GetObject(L"w.OcxState")));&lt;br /&gt;this-&gt;w-&gt;Size = System::Drawing::Size(269, 184);&lt;br /&gt;this-&gt;w-&gt;TabIndex = 0;&lt;br /&gt;//&lt;br /&gt;// BtnPlay&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnPlay-&gt;Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 14.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,&lt;br /&gt;static_cast&lt;/span&gt;&lt;system::byte&gt;&lt;span style="color:#ffffff;"&gt;(222)));&lt;br /&gt;this-&gt;BtnPlay-&gt;Location = System::Drawing::Point(12, 211);&lt;br /&gt;this-&gt;BtnPlay-&gt;Name = L"BtnPlay";&lt;br /&gt;this-&gt;BtnPlay-&gt;Size = System::Drawing::Size(267, 45);&lt;br /&gt;this-&gt;BtnPlay-&gt;TabIndex = 1;&lt;br /&gt;this-&gt;BtnPlay-&gt;Text = L"Play";&lt;br /&gt;this-&gt;BtnPlay-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnPlay-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnPlay_Click);&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(292, 266);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnPlay);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;w);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;(cli::safe_cast&lt;/span&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;span style="color:#ffffff;"&gt;(this-&gt;w))-&gt;EndInit();&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Play Sound&lt;br /&gt;private: System::Void BtnPlay_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;w-&gt;URL="D:\\Song\\01 Track 1.mp3";&lt;br /&gt;w-&gt;Ctlcontrols-&gt;play();&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;Text="Play Sound";&lt;br /&gt;this-&gt;BackColor=Color::Yellow;&lt;br /&gt;this-&gt;MaximizeBox=false;&lt;br /&gt;BtnPlay-&gt;BackColor=Color::Black;&lt;br /&gt;BtnPlay-&gt;ForeColor=Color::White;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;/system::byte&gt;&lt;/system::windows::forms::axhost::state^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;br /&gt;&lt;?XML:NAMESPACE PREFIX = System /&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;system::windows::forms::axhost::state^&gt;&lt;system::byte&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;/system::byte&gt;&lt;/system::windows::forms::axhost::state^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-33261003506887956?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/33261003506887956/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=33261003506887956' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/33261003506887956'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/33261003506887956'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/play-sound.html' title='Play Sound'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_MeJernKB7_c/SE31f6mxfjI/AAAAAAAAATY/tpNLY5im7W8/s72-c/Play+Sound.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-3166082864498867520</id><published>2008-06-09T20:27:00.001-07:00</published><updated>2008-06-09T20:29:36.259-07:00</updated><title type='text'>Draw Image on RichTextBox</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_MeJernKB7_c/SE3095GxHHI/AAAAAAAAATQ/6n01SizEve0/s1600-h/Draw+Image+on+RichTextBox.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210089688075934834" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_MeJernKB7_c/SE3095GxHHI/AAAAAAAAATQ/6n01SizEve0/s320/Draw+Image+on+RichTextBox.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My47 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::RichTextBox^ Rtf;&lt;br /&gt;private: System::Windows::Forms::Button^ BtnDrawImage;&lt;br /&gt;protected:&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;Rtf = (gcnew System::Windows::Forms::RichTextBox());&lt;br /&gt;this-&gt;BtnDrawImage = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// Rtf&lt;br /&gt;//&lt;br /&gt;this-&gt;Rtf-&gt;Location = System::Drawing::Point(12, 11);&lt;br /&gt;this-&gt;Rtf-&gt;Name = L"Rtf";&lt;br /&gt;this-&gt;Rtf-&gt;Size = System::Drawing::Size(268, 190);&lt;br /&gt;this-&gt;Rtf-&gt;TabIndex = 0;&lt;br /&gt;this-&gt;Rtf-&gt;Text = L"";&lt;br /&gt;//&lt;br /&gt;// BtnDrawImage&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnDrawImage-&gt;Location = System::Drawing::Point(12, 216);&lt;br /&gt;this-&gt;BtnDrawImage-&gt;Name = L"BtnDrawImage";&lt;br /&gt;this-&gt;BtnDrawImage-&gt;Size = System::Drawing::Size(267, 35);&lt;br /&gt;this-&gt;BtnDrawImage-&gt;TabIndex = 1;&lt;br /&gt;this-&gt;BtnDrawImage-&gt;Text = L"Draw Image";&lt;br /&gt;this-&gt;BtnDrawImage-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnDrawImage-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnDrawImage_Click);&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(292, 266);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnDrawImage);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;Rtf);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Draw Image on RichTextBox&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;Rtf-&gt;BackColor=Color::Red;&lt;br /&gt;this-&gt;Text="DrawImage on RichTextBox";&lt;br /&gt;this-&gt;FormBorderStyle=Windows::Forms::FormBorderStyle::FixedToolWindow;&lt;br /&gt;this-&gt;BackColor=Color::Gray;&lt;br /&gt;}&lt;br /&gt;private: System::Void BtnDrawImage_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;Graphics^g;&lt;br /&gt;Bitmap^b;&lt;br /&gt;b=gcnew Bitmap("C:\\Flower.Bmp");&lt;br /&gt;g=Rtf-&gt;CreateGraphics();&lt;br /&gt;g-&gt;DrawImage(b,Rectangle(10,10,200,200));&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-3166082864498867520?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/3166082864498867520/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=3166082864498867520' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/3166082864498867520'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/3166082864498867520'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/draw-image-on-richtextbox.html' title='Draw Image on RichTextBox'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_MeJernKB7_c/SE3095GxHHI/AAAAAAAAATQ/6n01SizEve0/s72-c/Draw+Image+on+RichTextBox.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-7518964113800698237</id><published>2008-06-09T20:21:00.001-07:00</published><updated>2008-06-09T20:25:56.369-07:00</updated><title type='text'>Copy And Paste in RichTextBox</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_MeJernKB7_c/SE30K38lszI/AAAAAAAAATI/Ztw0NIkUOdc/s1600-h/Copy+And+Paste+in+RichTextBox.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210088811591480114" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_MeJernKB7_c/SE30K38lszI/AAAAAAAAATI/Ztw0NIkUOdc/s320/Copy+And+Paste+in+RichTextBox.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My46 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::RichTextBox^ Rtf;&lt;br /&gt;protected:&lt;br /&gt;private: System::Windows::Forms::Button^ BtnCopy;&lt;br /&gt;private: System::Windows::Forms::Button^ BtnPaste;&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;Rtf = (gcnew System::Windows::Forms::RichTextBox());&lt;br /&gt;this-&gt;BtnCopy = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;BtnPaste = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// Rtf&lt;br /&gt;//&lt;br /&gt;this-&gt;Rtf-&gt;Location = System::Drawing::Point(10, 12);&lt;br /&gt;this-&gt;Rtf-&gt;Name = L"Rtf";&lt;br /&gt;this-&gt;Rtf-&gt;Size = System::Drawing::Size(272, 204);&lt;br /&gt;this-&gt;Rtf-&gt;TabIndex = 0;&lt;br /&gt;this-&gt;Rtf-&gt;Text = L"";&lt;br /&gt;//&lt;br /&gt;// BtnCopy&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnCopy-&gt;Location = System::Drawing::Point(12, 222);&lt;br /&gt;this-&gt;BtnCopy-&gt;Name = L"BtnCopy";&lt;br /&gt;this-&gt;BtnCopy-&gt;Size = System::Drawing::Size(121, 32);&lt;br /&gt;this-&gt;BtnCopy-&gt;TabIndex = 1;&lt;br /&gt;this-&gt;BtnCopy-&gt;Text = L"Copy";&lt;br /&gt;this-&gt;BtnCopy-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnCopy-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnCopy_Click);&lt;br /&gt;//&lt;br /&gt;// BtnPaste&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnPaste-&gt;Location = System::Drawing::Point(150, 222);&lt;br /&gt;this-&gt;BtnPaste-&gt;Name = L"BtnPaste";&lt;br /&gt;this-&gt;BtnPaste-&gt;Size = System::Drawing::Size(130, 32);&lt;br /&gt;this-&gt;BtnPaste-&gt;TabIndex = 2;&lt;br /&gt;this-&gt;BtnPaste-&gt;Text = L"Paste";&lt;br /&gt;this-&gt;BtnPaste-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnPaste-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnPaste_Click);&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(292, 266);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnPaste);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnCopy);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;Rtf);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Copy And Paste in RichTextBox&lt;br /&gt;private: System::Void BtnCopy_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;Rtf-&gt;Copy();&lt;br /&gt;}&lt;br /&gt;private: System::Void BtnPaste_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;Rtf-&gt;Paste();&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;Text="Copy And Paste in RichTextBox";&lt;br /&gt;this-&gt;BackColor=Color::Yellow;&lt;br /&gt;this-&gt;MaximizeBox=false;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-7518964113800698237?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/7518964113800698237/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=7518964113800698237' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/7518964113800698237'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/7518964113800698237'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/copy-and-paste-in-richtextbox.html' title='Copy And Paste in RichTextBox'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_MeJernKB7_c/SE30K38lszI/AAAAAAAAATI/Ztw0NIkUOdc/s72-c/Copy+And+Paste+in+RichTextBox.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-4513742428961126042</id><published>2008-06-09T20:18:00.000-07:00</published><updated>2008-06-09T20:20:58.236-07:00</updated><title type='text'>Show TextLength</title><content type='html'>&lt;a href="http://1.bp.blogspot.com/_MeJernKB7_c/SE3y6LUlCZI/AAAAAAAAATA/gSSDemhxC9U/s1600-h/Show+TextLength.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210087425222969746" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_MeJernKB7_c/SE3y6LUlCZI/AAAAAAAAATA/gSSDemhxC9U/s320/Show+TextLength.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My45 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::RichTextBox^ Rtf;&lt;br /&gt;private: System::Windows::Forms::Button^ BtnTextLength;&lt;br /&gt;protected:&lt;br /&gt;&lt;br /&gt;protected:&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;Rtf = (gcnew System::Windows::Forms::RichTextBox());&lt;br /&gt;this-&gt;BtnTextLength = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// Rtf&lt;br /&gt;//&lt;br /&gt;this-&gt;Rtf-&gt;Location = System::Drawing::Point(9, 14);&lt;br /&gt;this-&gt;Rtf-&gt;Name = L"Rtf";&lt;br /&gt;this-&gt;Rtf-&gt;Size = System::Drawing::Size(271, 194);&lt;br /&gt;this-&gt;Rtf-&gt;TabIndex = 0;&lt;br /&gt;this-&gt;Rtf-&gt;Text = L"";&lt;br /&gt;//&lt;br /&gt;// BtnTextLength&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnTextLength-&gt;Location = System::Drawing::Point(12, 223);&lt;br /&gt;this-&gt;BtnTextLength-&gt;Name = L"BtnTextLength";&lt;br /&gt;this-&gt;BtnTextLength-&gt;Size = System::Drawing::Size(267, 31);&lt;br /&gt;this-&gt;BtnTextLength-&gt;TabIndex = 1;&lt;br /&gt;this-&gt;BtnTextLength-&gt;Text = L"Show TextLength";&lt;br /&gt;this-&gt;BtnTextLength-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnTextLength-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnSave_Click);&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(292, 266);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnTextLength);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;Rtf);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Show TextLength&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;Text="Show TextLength";&lt;br /&gt;this-&gt;BackColor=Color::Black;&lt;br /&gt;this-&gt;MaximizeBox=false;&lt;br /&gt;Rtf-&gt;BackColor=Color::Yellow;&lt;br /&gt;Rtf-&gt;ForeColor=Color::Blue;&lt;br /&gt;}&lt;br /&gt;private: System::Void BtnSave_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;Text=Rtf-&gt;TextLength.ToString();&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-4513742428961126042?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/4513742428961126042/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=4513742428961126042' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/4513742428961126042'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/4513742428961126042'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/show-textlength.html' title='Show TextLength'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_MeJernKB7_c/SE3y6LUlCZI/AAAAAAAAATA/gSSDemhxC9U/s72-c/Show+TextLength.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-7727917142258012812</id><published>2008-06-09T20:17:00.001-07:00</published><updated>2008-06-09T20:18:40.154-07:00</updated><title type='text'>MixColor</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_MeJernKB7_c/SE3ybgEFqcI/AAAAAAAAAS4/0YXBmQI4g_E/s1600-h/MixColor.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210086898215004610" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_MeJernKB7_c/SE3ybgEFqcI/AAAAAAAAAS4/0YXBmQI4g_E/s320/MixColor.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My44 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::NumericUpDown^ nRed;&lt;br /&gt;protected:&lt;br /&gt;private: System::Windows::Forms::Label^ lblRed;&lt;br /&gt;private: System::Windows::Forms::NumericUpDown^ nGreen;&lt;br /&gt;private: System::Windows::Forms::NumericUpDown^ nBlue;&lt;br /&gt;private: System::Windows::Forms::Label^ lblGreen;&lt;br /&gt;private: System::Windows::Forms::Label^ lblBlue;&lt;br /&gt;private: System::Windows::Forms::PictureBox^ pctResult;&lt;br /&gt;private: System::Windows::Forms::Button^ BtnShowResult;&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;nRed = (gcnew System::Windows::Forms::NumericUpDown());&lt;br /&gt;this-&gt;lblRed = (gcnew System::Windows::Forms::Label());&lt;br /&gt;this-&gt;nGreen = (gcnew System::Windows::Forms::NumericUpDown());&lt;br /&gt;this-&gt;nBlue = (gcnew System::Windows::Forms::NumericUpDown());&lt;br /&gt;this-&gt;lblGreen = (gcnew System::Windows::Forms::Label());&lt;br /&gt;this-&gt;lblBlue = (gcnew System::Windows::Forms::Label());&lt;br /&gt;this-&gt;pctResult = (gcnew System::Windows::Forms::PictureBox());&lt;br /&gt;this-&gt;BtnShowResult = (gcnew System::Windows::Forms::Button());&lt;br /&gt;(cli::safe_cast&lt;/span&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;span style="color:#ffffff;"&gt;(this-&gt;nRed))-&gt;BeginInit();&lt;br /&gt;(cli::safe_cast&lt;/span&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;span style="color:#ffffff;"&gt;(this-&gt;nGreen))-&gt;BeginInit();&lt;br /&gt;(cli::safe_cast&lt;/span&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;span style="color:#ffffff;"&gt;(this-&gt;nBlue))-&gt;BeginInit();&lt;br /&gt;(cli::safe_cast&lt;/span&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;span style="color:#ffffff;"&gt;(this-&gt;pctResult))-&gt;BeginInit();&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// nRed&lt;br /&gt;//&lt;br /&gt;this-&gt;nRed-&gt;Location = System::Drawing::Point(51, 22);&lt;br /&gt;this-&gt;nRed-&gt;Name = L"nRed";&lt;br /&gt;this-&gt;nRed-&gt;Size = System::Drawing::Size(43, 20);&lt;br /&gt;this-&gt;nRed-&gt;TabIndex = 0;&lt;br /&gt;this-&gt;nRed-&gt;ValueChanged += gcnew System::EventHandler(this, &amp;amp;Form1::nRed_ValueChanged);&lt;br /&gt;//&lt;br /&gt;// lblRed&lt;br /&gt;//&lt;br /&gt;this-&gt;lblRed-&gt;AutoSize = true;&lt;br /&gt;this-&gt;lblRed-&gt;Location = System::Drawing::Point(12, 24);&lt;br /&gt;this-&gt;lblRed-&gt;Name = L"lblRed";&lt;br /&gt;this-&gt;lblRed-&gt;Size = System::Drawing::Size(33, 13);&lt;br /&gt;this-&gt;lblRed-&gt;TabIndex = 1;&lt;br /&gt;this-&gt;lblRed-&gt;Text = L"Red :";&lt;br /&gt;//&lt;br /&gt;// nGreen&lt;br /&gt;//&lt;br /&gt;this-&gt;nGreen-&gt;Location = System::Drawing::Point(51, 61);&lt;br /&gt;this-&gt;nGreen-&gt;Name = L"nGreen";&lt;br /&gt;this-&gt;nGreen-&gt;Size = System::Drawing::Size(43, 20);&lt;br /&gt;this-&gt;nGreen-&gt;TabIndex = 2;&lt;br /&gt;this-&gt;nGreen-&gt;ValueChanged += gcnew System::EventHandler(this, &amp;amp;Form1::nGreen_ValueChanged);&lt;br /&gt;//&lt;br /&gt;// nBlue&lt;br /&gt;//&lt;br /&gt;this-&gt;nBlue-&gt;Location = System::Drawing::Point(51, 97);&lt;br /&gt;this-&gt;nBlue-&gt;Name = L"nBlue";&lt;br /&gt;this-&gt;nBlue-&gt;Size = System::Drawing::Size(43, 20);&lt;br /&gt;this-&gt;nBlue-&gt;TabIndex = 3;&lt;br /&gt;this-&gt;nBlue-&gt;ValueChanged += gcnew System::EventHandler(this, &amp;amp;Form1::nBlue_ValueChanged);&lt;br /&gt;//&lt;br /&gt;// lblGreen&lt;br /&gt;//&lt;br /&gt;this-&gt;lblGreen-&gt;AutoSize = true;&lt;br /&gt;this-&gt;lblGreen-&gt;Location = System::Drawing::Point(12, 63);&lt;br /&gt;this-&gt;lblGreen-&gt;Name = L"lblGreen";&lt;br /&gt;this-&gt;lblGreen-&gt;Size = System::Drawing::Size(42, 13);&lt;br /&gt;this-&gt;lblGreen-&gt;TabIndex = 4;&lt;br /&gt;this-&gt;lblGreen-&gt;Text = L"Green :";&lt;br /&gt;//&lt;br /&gt;// lblBlue&lt;br /&gt;//&lt;br /&gt;this-&gt;lblBlue-&gt;AutoSize = true;&lt;br /&gt;this-&gt;lblBlue-&gt;Location = System::Drawing::Point(12, 99);&lt;br /&gt;this-&gt;lblBlue-&gt;Name = L"lblBlue";&lt;br /&gt;this-&gt;lblBlue-&gt;Size = System::Drawing::Size(34, 13);&lt;br /&gt;this-&gt;lblBlue-&gt;TabIndex = 5;&lt;br /&gt;this-&gt;lblBlue-&gt;Text = L"Blue :";&lt;br /&gt;//&lt;br /&gt;// pctResult&lt;br /&gt;//&lt;br /&gt;this-&gt;pctResult-&gt;BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;&lt;br /&gt;this-&gt;pctResult-&gt;Location = System::Drawing::Point(109, 23);&lt;br /&gt;this-&gt;pctResult-&gt;Name = L"pctResult";&lt;br /&gt;this-&gt;pctResult-&gt;Size = System::Drawing::Size(170, 102);&lt;br /&gt;this-&gt;pctResult-&gt;TabIndex = 6;&lt;br /&gt;this-&gt;pctResult-&gt;TabStop = false;&lt;br /&gt;//&lt;br /&gt;// BtnShowResult&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnShowResult-&gt;Location = System::Drawing::Point(12, 131);&lt;br /&gt;this-&gt;BtnShowResult-&gt;Name = L"BtnShowResult";&lt;br /&gt;this-&gt;BtnShowResult-&gt;Size = System::Drawing::Size(267, 30);&lt;br /&gt;this-&gt;BtnShowResult-&gt;TabIndex = 7;&lt;br /&gt;this-&gt;BtnShowResult-&gt;Text = L"Show Result";&lt;br /&gt;this-&gt;BtnShowResult-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnShowResult-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnShowResult_Click);&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(292, 162);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnShowResult);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;pctResult);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;lblBlue);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;lblGreen);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;nBlue);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;nGreen);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;lblRed);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;nRed);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;(cli::safe_cast&lt;/span&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;span style="color:#ffffff;"&gt;(this-&gt;nRed))-&gt;EndInit();&lt;br /&gt;(cli::safe_cast&lt;/span&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;span style="color:#ffffff;"&gt;(this-&gt;nGreen))-&gt;EndInit();&lt;br /&gt;(cli::safe_cast&lt;/span&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;span style="color:#ffffff;"&gt;(this-&gt;nBlue))-&gt;EndInit();&lt;br /&gt;(cli::safe_cast&lt;/span&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;span style="color:#ffffff;"&gt;(this-&gt;pctResult))-&gt;EndInit();&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;this-&gt;PerformLayout();&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//MixColor&lt;br /&gt;int cRed;&lt;br /&gt;int cGreen;&lt;br /&gt;int cBlue;&lt;br /&gt;void UpdateMixColor()&lt;br /&gt;{&lt;br /&gt;pctResult-&gt;BackColor=Color::FromArgb(cRed,cGreen,cBlue);&lt;br /&gt;}&lt;br /&gt;private: System::Void nRed_ValueChanged(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;cRed=Convert::ToInt32(nRed-&gt;Value);&lt;br /&gt;UpdateMixColor();&lt;br /&gt;}&lt;br /&gt;private: System::Void nGreen_ValueChanged(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;cGreen=Convert::ToInt32(nGreen-&gt;Value);&lt;br /&gt;UpdateMixColor();&lt;br /&gt;}&lt;br /&gt;private: System::Void nBlue_ValueChanged(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;cBlue=Convert::ToInt32(nBlue-&gt;Value);&lt;br /&gt;UpdateMixColor();&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;nRed-&gt;Maximum=255;&lt;br /&gt;nGreen-&gt;Maximum=255;&lt;br /&gt;nBlue-&gt;Maximum=255;&lt;br /&gt;this-&gt;Text="MixColor";&lt;br /&gt;this-&gt;MaximizeBox=false;&lt;br /&gt;}&lt;br /&gt;private: System::Void BtnShowResult_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;UpdateMixColor();&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;br /&gt;&lt;?XML:NAMESPACE PREFIX = System /&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-7727917142258012812?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/7727917142258012812/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=7727917142258012812' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/7727917142258012812'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/7727917142258012812'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/mixcolor.html' title='MixColor'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_MeJernKB7_c/SE3ybgEFqcI/AAAAAAAAAS4/0YXBmQI4g_E/s72-c/MixColor.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-6977868276026641045</id><published>2008-06-09T20:13:00.001-07:00</published><updated>2008-06-09T20:16:20.488-07:00</updated><title type='text'>Using maskedTextBox</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_MeJernKB7_c/SE3x7CNT2rI/AAAAAAAAASw/IPxETk1g6DE/s1600-h/Using+maskedTextBox.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210086340444805810" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_MeJernKB7_c/SE3x7CNT2rI/AAAAAAAAASw/IPxETk1g6DE/s320/Using+maskedTextBox.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My43 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::MaskedTextBox^ mtxt;&lt;br /&gt;private: System::Windows::Forms::Button^ BtnSee;&lt;br /&gt;protected:&lt;br /&gt;protected:&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;mtxt = (gcnew System::Windows::Forms::MaskedTextBox());&lt;br /&gt;this-&gt;BtnSee = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// mtxt&lt;br /&gt;//&lt;br /&gt;this-&gt;mtxt-&gt;Location = System::Drawing::Point(12, 12);&lt;br /&gt;this-&gt;mtxt-&gt;Name = L"mtxt";&lt;br /&gt;this-&gt;mtxt-&gt;PasswordChar = '*';&lt;br /&gt;this-&gt;mtxt-&gt;Size = System::Drawing::Size(334, 20);&lt;br /&gt;this-&gt;mtxt-&gt;TabIndex = 0;&lt;br /&gt;//&lt;br /&gt;// BtnSee&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnSee-&gt;Location = System::Drawing::Point(16, 41);&lt;br /&gt;this-&gt;BtnSee-&gt;Name = L"BtnSee";&lt;br /&gt;this-&gt;BtnSee-&gt;Size = System::Drawing::Size(329, 23);&lt;br /&gt;this-&gt;BtnSee-&gt;TabIndex = 1;&lt;br /&gt;this-&gt;BtnSee-&gt;Text = L"See";&lt;br /&gt;this-&gt;BtnSee-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnSee-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnSee_Click);&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(358, 71);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnSee);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;mtxt);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;this-&gt;PerformLayout();&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Using maskedTextBox&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;mtxt-&gt;PasswordChar='*';&lt;br /&gt;this-&gt;Text="Using maskedTextBox";&lt;br /&gt;this-&gt;MaximizeBox=false;&lt;br /&gt;this-&gt;BackColor=Color::Gray;&lt;br /&gt;mtxt-&gt;BackColor=Color::Yellow;&lt;br /&gt;mtxt-&gt;ForeColor=Color::Blue;&lt;br /&gt;}&lt;br /&gt;private: System::Void BtnSee_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;Text=mtxt-&gt;Text;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-6977868276026641045?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/6977868276026641045/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=6977868276026641045' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/6977868276026641045'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/6977868276026641045'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/using-maskedtextbox.html' title='Using maskedTextBox'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_MeJernKB7_c/SE3x7CNT2rI/AAAAAAAAASw/IPxETk1g6DE/s72-c/Using+maskedTextBox.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-4037021047473183339</id><published>2008-06-09T20:11:00.000-07:00</published><updated>2008-06-09T20:13:01.017-07:00</updated><title type='text'>Eject CD</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_MeJernKB7_c/SE3xDr3K86I/AAAAAAAAASg/4DnjP7RunRA/s1600-h/Eject+CD.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210085389553562530" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_MeJernKB7_c/SE3xDr3K86I/AAAAAAAAASg/4DnjP7RunRA/s320/Eject+CD.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My42 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: AxWMPLib::AxWindowsMediaPlayer^ w;&lt;br /&gt;protected:&lt;br /&gt;private: System::Windows::Forms::Button^ BtnEjectCD;&lt;br /&gt;protected:&lt;br /&gt;protected:&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));&lt;br /&gt;this-&gt;w = (gcnew AxWMPLib::AxWindowsMediaPlayer());&lt;br /&gt;this-&gt;BtnEjectCD = (gcnew System::Windows::Forms::Button());&lt;br /&gt;(cli::safe_cast&lt;/span&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;span style="color:#ffffff;"&gt;(this-&gt;w))-&gt;BeginInit();&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// w&lt;br /&gt;//&lt;br /&gt;this-&gt;w-&gt;Enabled = true;&lt;br /&gt;this-&gt;w-&gt;Location = System::Drawing::Point(12, 12);&lt;br /&gt;this-&gt;w-&gt;Name = L"w";&lt;br /&gt;this-&gt;w-&gt;OcxState = (cli::safe_cast&lt;/span&gt;&lt;system::windows::forms::axhost::state^&gt;&lt;span style="color:#ffffff;"&gt;(resources-&gt;GetObject(L"w.OcxState")));&lt;br /&gt;this-&gt;w-&gt;Size = System::Drawing::Size(10, 10);&lt;br /&gt;this-&gt;w-&gt;TabIndex = 0;&lt;br /&gt;//&lt;br /&gt;// BtnEjectCD&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnEjectCD-&gt;Location = System::Drawing::Point(12, 12);&lt;br /&gt;this-&gt;BtnEjectCD-&gt;Name = L"BtnEjectCD";&lt;br /&gt;this-&gt;BtnEjectCD-&gt;Size = System::Drawing::Size(264, 53);&lt;br /&gt;this-&gt;BtnEjectCD-&gt;TabIndex = 1;&lt;br /&gt;this-&gt;BtnEjectCD-&gt;Text = L"Eject CD";&lt;br /&gt;this-&gt;BtnEjectCD-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnEjectCD-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnEjectCD_Click);&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(288, 77);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnEjectCD);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;w);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;(cli::safe_cast&lt;/span&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;span style="color:#ffffff;"&gt;(this-&gt;w))-&gt;EndInit();&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Eject CD&lt;br /&gt;private: System::Void BtnEjectCD_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;w-&gt;cdromCollection-&gt;getByDriveSpecifier("e")-&gt;eject();&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;Text="Eject CD";&lt;br /&gt;this-&gt;BackColor=Color::Black;&lt;br /&gt;this-&gt;MaximizeBox=false;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;/system::windows::forms::axhost::state^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;br /&gt;&lt;?XML:NAMESPACE PREFIX = System /&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;system::windows::forms::axhost::state^&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;/system::windows::forms::axhost::state^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-4037021047473183339?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/4037021047473183339/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=4037021047473183339' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/4037021047473183339'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/4037021047473183339'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/eject-cd.html' title='Eject CD'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_MeJernKB7_c/SE3xDr3K86I/AAAAAAAAASg/4DnjP7RunRA/s72-c/Eject+CD.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-5773606203863361888</id><published>2008-06-09T18:14:00.001-07:00</published><updated>2008-06-09T20:11:20.369-07:00</updated><title type='text'>Open RTF File</title><content type='html'>&lt;a href="http://2.bp.blogspot.com/_MeJernKB7_c/SE3wrLRebFI/AAAAAAAAASY/ejwiqfmi9ak/s1600-h/Open+RTF+File.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210084968488660050" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_MeJernKB7_c/SE3wrLRebFI/AAAAAAAAASY/ejwiqfmi9ak/s320/Open+RTF+File.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My41 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::RichTextBox^ rtf;&lt;br /&gt;protected:&lt;br /&gt;private: System::Windows::Forms::Button^ BtnOpenFile;&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;rtf = (gcnew System::Windows::Forms::RichTextBox());&lt;br /&gt;this-&gt;BtnOpenFile = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// rtf&lt;br /&gt;//&lt;br /&gt;this-&gt;rtf-&gt;Location = System::Drawing::Point(12, 12);&lt;br /&gt;this-&gt;rtf-&gt;Name = L"rtf";&lt;br /&gt;this-&gt;rtf-&gt;Size = System::Drawing::Size(475, 297);&lt;br /&gt;this-&gt;rtf-&gt;TabIndex = 0;&lt;br /&gt;this-&gt;rtf-&gt;Text = L"";&lt;br /&gt;//&lt;br /&gt;// BtnOpenFile&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnOpenFile-&gt;Location = System::Drawing::Point(12, 315);&lt;br /&gt;this-&gt;BtnOpenFile-&gt;Name = L"BtnOpenFile";&lt;br /&gt;this-&gt;BtnOpenFile-&gt;Size = System::Drawing::Size(475, 35);&lt;br /&gt;this-&gt;BtnOpenFile-&gt;TabIndex = 1;&lt;br /&gt;this-&gt;BtnOpenFile-&gt;Text = L"Open RTF File";&lt;br /&gt;this-&gt;BtnOpenFile-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnOpenFile-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnOpenFile_Click);&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(499, 353);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnOpenFile);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;rtf);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Open RTF File&lt;br /&gt;private: System::Void BtnOpenFile_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;rtf-&gt;LoadFile("C:\\RTF.rtf");&lt;br /&gt;rtf-&gt;BackColor=Color::Yellow;&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;Text="Open RTF File";&lt;br /&gt;this-&gt;BackColor=Color::Red;&lt;br /&gt;this-&gt;MaximizeBox=false;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-5773606203863361888?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/5773606203863361888/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=5773606203863361888' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/5773606203863361888'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/5773606203863361888'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/open-rtf-file.html' title='Open RTF File'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_MeJernKB7_c/SE3wrLRebFI/AAAAAAAAASY/ejwiqfmi9ak/s72-c/Open+RTF+File.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-5021340164900092520</id><published>2008-06-09T18:11:00.000-07:00</published><updated>2008-06-09T18:13:58.574-07:00</updated><title type='text'>Show Animation Form</title><content type='html'>&lt;a href="http://2.bp.blogspot.com/_MeJernKB7_c/SE3VG7IXHFI/AAAAAAAAASQ/hql9jReV7w4/s1600-h/Show+Animation+Form.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210054658866224210" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_MeJernKB7_c/SE3VG7IXHFI/AAAAAAAAASQ/hql9jReV7w4/s320/Show+Animation+Form.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My40 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::Timer^ t;&lt;br /&gt;protected:&lt;br /&gt;private: System::ComponentModel::IContainer^ components;&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;components = (gcnew System::ComponentModel::Container());&lt;br /&gt;this-&gt;t = (gcnew System::Windows::Forms::Timer(this-&gt;components));&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// t&lt;br /&gt;//&lt;br /&gt;this-&gt;t-&gt;Interval = 1;&lt;br /&gt;this-&gt;t-&gt;Tick += gcnew System::EventHandler(this, &amp;amp;Form1::t_Tick);&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(292, 266);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Show Animation Form&lt;br /&gt;private: System::Void t_Tick(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;Width=this-&gt;Width+5;&lt;br /&gt;this-&gt;Height=this-&gt;Height+5;&lt;br /&gt;if(this-&gt;Width&gt;=300 &amp;amp;&amp;amp; this-&gt;Height&gt;=300)&lt;br /&gt;{&lt;br /&gt;t-&gt;Enabled=false;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;Width=10;&lt;br /&gt;this-&gt;Height=10;&lt;br /&gt;this-&gt;BackColor=Color::Azure;&lt;br /&gt;this-&gt;Text="Show Animation Form";&lt;br /&gt;this-&gt;MaximizeBox=false;&lt;br /&gt;this-&gt;MinimizeBox=false;&lt;br /&gt;t-&gt;Enabled=true;&lt;br /&gt;t-&gt;Interval=100;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-5021340164900092520?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/5021340164900092520/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=5021340164900092520' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/5021340164900092520'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/5021340164900092520'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/show-animation-form.html' title='Show Animation Form'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_MeJernKB7_c/SE3VG7IXHFI/AAAAAAAAASQ/hql9jReV7w4/s72-c/Show+Animation+Form.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-2704029713756063399</id><published>2008-06-09T18:06:00.000-07:00</published><updated>2008-06-09T18:11:27.452-07:00</updated><title type='text'>Move Button</title><content type='html'>&lt;a href="http://2.bp.blogspot.com/_MeJernKB7_c/SE3UarC01TI/AAAAAAAAASI/-FsL2wIZOoc/s1600-h/Move+Button.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210053898633794866" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_MeJernKB7_c/SE3UarC01TI/AAAAAAAAASI/-FsL2wIZOoc/s320/Move+Button.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My39 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::Button^ BtnMoveButton;&lt;br /&gt;protected:&lt;br /&gt;private: System::Windows::Forms::Label^ lblHelp;&lt;br /&gt;private: System::Windows::Forms::Timer^ t;&lt;br /&gt;private: System::ComponentModel::IContainer^ components;&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;components = (gcnew System::ComponentModel::Container());&lt;br /&gt;this-&gt;BtnMoveButton = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;lblHelp = (gcnew System::Windows::Forms::Label());&lt;br /&gt;this-&gt;t = (gcnew System::Windows::Forms::Timer(this-&gt;components));&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// BtnMoveButton&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnMoveButton-&gt;Location = System::Drawing::Point(96, 63);&lt;br /&gt;this-&gt;BtnMoveButton-&gt;Name = L"BtnMoveButton";&lt;br /&gt;this-&gt;BtnMoveButton-&gt;Size = System::Drawing::Size(98, 16);&lt;br /&gt;this-&gt;BtnMoveButton-&gt;TabIndex = 0;&lt;br /&gt;this-&gt;BtnMoveButton-&gt;Text = L"...";&lt;br /&gt;this-&gt;BtnMoveButton-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnMoveButton-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnMoveButton_Click);&lt;br /&gt;//&lt;br /&gt;// lblHelp&lt;br /&gt;//&lt;br /&gt;this-&gt;lblHelp-&gt;AutoSize = true;&lt;br /&gt;this-&gt;lblHelp-&gt;Location = System::Drawing::Point(93, 25);&lt;br /&gt;this-&gt;lblHelp-&gt;Name = L"lblHelp";&lt;br /&gt;this-&gt;lblHelp-&gt;Size = System::Drawing::Size(101, 13);&lt;br /&gt;this-&gt;lblHelp-&gt;TabIndex = 1;&lt;br /&gt;this-&gt;lblHelp-&gt;Text = L"Click Button to Start";&lt;br /&gt;//&lt;br /&gt;// t&lt;br /&gt;//&lt;br /&gt;this-&gt;t-&gt;Interval = 1;&lt;br /&gt;this-&gt;t-&gt;Tick += gcnew System::EventHandler(this, &amp;amp;Form1::t_Tick);&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(292, 95);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;lblHelp);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnMoveButton);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;this-&gt;PerformLayout();&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Move Button&lt;br /&gt;private: System::Void BtnMoveButton_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;t-&gt;Enabled=true;&lt;br /&gt;t-&gt;Interval=10;&lt;br /&gt;}&lt;br /&gt;private: System::Void t_Tick(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;BtnMoveButton-&gt;Left=BtnMoveButton-&gt;Left+1;&lt;br /&gt;if(BtnMoveButton-&gt;Left&gt;=this-&gt;Width)&lt;br /&gt;{&lt;br /&gt;BtnMoveButton-&gt;Left=0;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;Text="Move Button";&lt;br /&gt;this-&gt;BackColor=Color::Aquamarine;&lt;br /&gt;this-&gt;MaximizeBox=false;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-2704029713756063399?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/2704029713756063399/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=2704029713756063399' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/2704029713756063399'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/2704029713756063399'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/move-button.html' title='Move Button'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_MeJernKB7_c/SE3UarC01TI/AAAAAAAAASI/-FsL2wIZOoc/s72-c/Move+Button.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-9019583406502849875</id><published>2008-06-09T18:03:00.000-07:00</published><updated>2008-06-09T18:05:15.673-07:00</updated><title type='text'>Using Switch case</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_MeJernKB7_c/SE3TEYVGX1I/AAAAAAAAAR4/N6IRdWXhhEI/s1600-h/Using+Switch+case.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210052416141418322" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_MeJernKB7_c/SE3TEYVGX1I/AAAAAAAAAR4/N6IRdWXhhEI/s320/Using+Switch+case.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My38 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(292, 266);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;MouseDown += gcnew System::Windows::Forms::MouseEventHandler(this, &amp;amp;Form1::Form1_MouseDown);&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Using Switch case&lt;br /&gt;private: System::Void Form1_MouseDown(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) {&lt;br /&gt;static int i;&lt;br /&gt;switch(i)&lt;br /&gt;{&lt;br /&gt;case 0:&lt;br /&gt;{&lt;br /&gt;this-&gt;BackColor=Color::Red;&lt;br /&gt;}break;&lt;br /&gt;case 1:&lt;br /&gt;{&lt;br /&gt;this-&gt;BackColor=Color::Yellow;&lt;br /&gt;}break;&lt;br /&gt;case 2:&lt;br /&gt;{&lt;br /&gt;this-&gt;BackColor=Color::Black;&lt;br /&gt;}break;&lt;br /&gt;case 3:&lt;br /&gt;{&lt;br /&gt;this-&gt;BackColor=Color::Blue;&lt;br /&gt;}break;&lt;br /&gt;}&lt;br /&gt;i++;&lt;br /&gt;if(i&gt;3)&lt;br /&gt;{&lt;br /&gt;i=0;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;Text="Using Switch Case";&lt;br /&gt;this-&gt;MaximizeBox=false;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-9019583406502849875?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/9019583406502849875/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=9019583406502849875' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/9019583406502849875'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/9019583406502849875'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/using-switch-case.html' title='Using Switch case'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_MeJernKB7_c/SE3TEYVGX1I/AAAAAAAAAR4/N6IRdWXhhEI/s72-c/Using+Switch+case.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-5209986731866899805</id><published>2008-06-09T17:55:00.000-07:00</published><updated>2008-06-09T18:02:28.478-07:00</updated><title type='text'>Show Path File</title><content type='html'>&lt;a href="http://2.bp.blogspot.com/_MeJernKB7_c/SE3Sb7dTZ1I/AAAAAAAAARw/4mgF2I9YuwQ/s1600-h/Show+Path+File.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210051721196431186" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_MeJernKB7_c/SE3Sb7dTZ1I/AAAAAAAAARw/4mgF2I9YuwQ/s320/Show+Path+File.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My37 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::Button^ BtnShowPathFile;&lt;br /&gt;protected:&lt;br /&gt;private: System::Windows::Forms::Label^ lblPathFile;&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;BtnShowPathFile = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;lblPathFile = (gcnew System::Windows::Forms::Label());&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// BtnShowPathFile&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnShowPathFile-&gt;Location = System::Drawing::Point(12, 99);&lt;br /&gt;this-&gt;BtnShowPathFile-&gt;Name = L"BtnShowPathFile";&lt;br /&gt;this-&gt;BtnShowPathFile-&gt;Size = System::Drawing::Size(557, 50);&lt;br /&gt;this-&gt;BtnShowPathFile-&gt;TabIndex = 0;&lt;br /&gt;this-&gt;BtnShowPathFile-&gt;Text = L"Show Path File";&lt;br /&gt;this-&gt;BtnShowPathFile-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnShowPathFile-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnShowPathFile_Click);&lt;br /&gt;//&lt;br /&gt;// lblPathFile&lt;br /&gt;//&lt;br /&gt;this-&gt;lblPathFile-&gt;AutoSize = true;&lt;br /&gt;this-&gt;lblPathFile-&gt;Location = System::Drawing::Point(24, 41);&lt;br /&gt;this-&gt;lblPathFile-&gt;Name = L"lblPathFile";&lt;br /&gt;this-&gt;lblPathFile-&gt;Size = System::Drawing::Size(35, 13);&lt;br /&gt;this-&gt;lblPathFile-&gt;TabIndex = 1;&lt;br /&gt;this-&gt;lblPathFile-&gt;Text = L"label1";&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(581, 161);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;lblPathFile);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnShowPathFile);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;this-&gt;PerformLayout();&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Show Path File&lt;br /&gt;OpenFileDialog^OpFile;&lt;br /&gt;private: System::Void BtnShowPathFile_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;OpFile=gcnew OpenFileDialog();&lt;br /&gt;OpFile-&gt;ShowDialog();&lt;br /&gt;lblPathFile-&gt;Text="Path File : "+OpFile-&gt;FileName;&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;Text="Show Path File";&lt;br /&gt;this-&gt;BackColor=Color::Yellow;&lt;br /&gt;this-&gt;FormBorderStyle=Windows::Forms::FormBorderStyle::FixedToolWindow;&lt;br /&gt;lblPathFile-&gt;Text="Path File : ";&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-5209986731866899805?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/5209986731866899805/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=5209986731866899805' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/5209986731866899805'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/5209986731866899805'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/show-path-file.html' title='Show Path File'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_MeJernKB7_c/SE3Sb7dTZ1I/AAAAAAAAARw/4mgF2I9YuwQ/s72-c/Show+Path+File.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-2418028687649629380</id><published>2008-06-09T17:50:00.000-07:00</published><updated>2008-06-09T17:54:27.928-07:00</updated><title type='text'>Open ColorDialog</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_MeJernKB7_c/SE3QbaCuvvI/AAAAAAAAARo/A8fGRVcANdI/s1600-h/Open+ColorDialog.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210049513203351282" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_MeJernKB7_c/SE3QbaCuvvI/AAAAAAAAARo/A8fGRVcANdI/s320/Open+ColorDialog.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My36 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::ColorDialog^ ColorDialog;&lt;br /&gt;protected:&lt;br /&gt;private: System::Windows::Forms::Button^ BtnOpenColorDialog;&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;ColorDialog = (gcnew System::Windows::Forms::ColorDialog());&lt;br /&gt;this-&gt;BtnOpenColorDialog = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// BtnOpenColorDialog&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnOpenColorDialog-&gt;Location = System::Drawing::Point(13, 16);&lt;br /&gt;this-&gt;BtnOpenColorDialog-&gt;Name = L"BtnOpenColorDialog";&lt;br /&gt;this-&gt;BtnOpenColorDialog-&gt;Size = System::Drawing::Size(267, 46);&lt;br /&gt;this-&gt;BtnOpenColorDialog-&gt;TabIndex = 0;&lt;br /&gt;this-&gt;BtnOpenColorDialog-&gt;Text = L"Open ColorDialog";&lt;br /&gt;this-&gt;BtnOpenColorDialog-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnOpenColorDialog-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnOpenColorDialog_Click);&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(292, 75);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnOpenColorDialog);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Open ColorDialog&lt;br /&gt;private: System::Void BtnOpenColorDialog_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;ColorDialog-&gt;AllowFullOpen=true;&lt;br /&gt;ColorDialog-&gt;AnyColor=true;&lt;br /&gt;if(ColorDialog-&gt;ShowDialog()==Windows::Forms::DialogResult::OK)&lt;br /&gt;{&lt;br /&gt;this-&gt;BackColor=ColorDialog-&gt;Color;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;Text="Open ColorDialog";&lt;br /&gt;this-&gt;MaximizeBox=false;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-2418028687649629380?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/2418028687649629380/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=2418028687649629380' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/2418028687649629380'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/2418028687649629380'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/open-colordialog.html' title='Open ColorDialog'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_MeJernKB7_c/SE3QbaCuvvI/AAAAAAAAARo/A8fGRVcANdI/s72-c/Open+ColorDialog.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-5635141952176229721</id><published>2008-06-09T17:42:00.001-07:00</published><updated>2008-06-09T17:46:55.880-07:00</updated><title type='text'>Show Time And Date</title><content type='html'>&lt;a href="http://2.bp.blogspot.com/_MeJernKB7_c/SE3Ox9pDn6I/AAAAAAAAARY/ZGLdsdfZAGM/s1600-h/Show+Time+And+Date.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210047701693210530" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_MeJernKB7_c/SE3Ox9pDn6I/AAAAAAAAARY/ZGLdsdfZAGM/s320/Show+Time+And+Date.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My35 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::Button^ BtnShowTimeAndDate;&lt;br /&gt;private: System::Windows::Forms::Timer^ t;&lt;br /&gt;private: System::ComponentModel::IContainer^ components;&lt;br /&gt;protected:&lt;br /&gt;protected:&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;components = (gcnew System::ComponentModel::Container());&lt;br /&gt;this-&gt;BtnShowTimeAndDate = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;t = (gcnew System::Windows::Forms::Timer(this-&gt;components));&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// BtnShowTimeAndDate&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnShowTimeAndDate-&gt;Location = System::Drawing::Point(15, 12);&lt;br /&gt;this-&gt;BtnShowTimeAndDate-&gt;Name = L"BtnShowTimeAndDate";&lt;br /&gt;this-&gt;BtnShowTimeAndDate-&gt;Size = System::Drawing::Size(321, 68);&lt;br /&gt;this-&gt;BtnShowTimeAndDate-&gt;TabIndex = 0;&lt;br /&gt;this-&gt;BtnShowTimeAndDate-&gt;Text = L"Show Time And Date";&lt;br /&gt;this-&gt;BtnShowTimeAndDate-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnShowTimeAndDate-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnShowTimeAndDate_Click);&lt;br /&gt;//&lt;br /&gt;// t&lt;br /&gt;//&lt;br /&gt;this-&gt;t-&gt;Interval = 1;&lt;br /&gt;this-&gt;t-&gt;Tick += gcnew System::EventHandler(this, &amp;amp;Form1::t_Tick);&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(348, 92);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnShowTimeAndDate);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Show Time And Date&lt;br /&gt;String^ShTimeAndDate;&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;Text="Show Time And Date";&lt;br /&gt;this-&gt;MaximizeBox=false;&lt;br /&gt;this-&gt;BackColor=Color::PaleGoldenrod;&lt;br /&gt;BtnShowTimeAndDate-&gt;BackColor=Color::Red;&lt;br /&gt;BtnShowTimeAndDate-&gt;ForeColor=Color::White;&lt;br /&gt;}&lt;br /&gt;private: System::Void BtnShowTimeAndDate_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;t-&gt;Enabled=true;&lt;br /&gt;}&lt;br /&gt;private: System::Void t_Tick(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;ShTimeAndDate=System::DateTime::Now.ToString();&lt;br /&gt;this-&gt;Text=ShTimeAndDate;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-5635141952176229721?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/5635141952176229721/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=5635141952176229721' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/5635141952176229721'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/5635141952176229721'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/show-time-and-date.html' title='Show Time And Date'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_MeJernKB7_c/SE3Ox9pDn6I/AAAAAAAAARY/ZGLdsdfZAGM/s72-c/Show+Time+And+Date.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-2480405897591149730</id><published>2008-06-09T17:39:00.000-07:00</published><updated>2008-06-09T17:41:36.953-07:00</updated><title type='text'>Remove Items In ListBox</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_MeJernKB7_c/SE3Nr6etQrI/AAAAAAAAARQ/Df7iUtHH-sQ/s1600-h/Remove+Items+In+ListBox.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210046498253652658" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_MeJernKB7_c/SE3Nr6etQrI/AAAAAAAAARQ/Df7iUtHH-sQ/s320/Remove+Items+In+ListBox.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My34 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::ListBox^ lst;&lt;br /&gt;protected:&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;lst = (gcnew System::Windows::Forms::ListBox());&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// lst&lt;br /&gt;//&lt;br /&gt;this-&gt;lst-&gt;FormattingEnabled = true;&lt;br /&gt;this-&gt;lst-&gt;Items-&gt;AddRange(gcnew cli::array&lt;&gt;(8) {L"Item 1", L"Item 2", L"Item 3", L"Item 4", L"Item 5",&lt;br /&gt;L"Item 6", L"Item 7", L"Item 8"});&lt;br /&gt;this-&gt;lst-&gt;Location = System::Drawing::Point(8, 10);&lt;br /&gt;this-&gt;lst-&gt;Name = L"lst";&lt;br /&gt;this-&gt;lst-&gt;Size = System::Drawing::Size(271, 121);&lt;br /&gt;this-&gt;lst-&gt;TabIndex = 0;&lt;br /&gt;this-&gt;lst-&gt;DoubleClick += gcnew System::EventHandler(this, &amp;amp;Form1::lst_DoubleClick);&lt;br /&gt;this-&gt;lst-&gt;SelectedIndexChanged += gcnew System::EventHandler(this, &amp;amp;Form1::lst_SelectedIndexChanged);&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(292, 141);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;lst);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Remove Items In ListBox&lt;br /&gt;private: System::Void lst_DoubleClick(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;Text=lst-&gt;Text;&lt;br /&gt;lst-&gt;Items-&gt;RemoveAt(lst-&gt;SelectedIndex);&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;Text="Romove Items In ListBox";&lt;br /&gt;this-&gt;MaximizeBox=false;&lt;br /&gt;}&lt;br /&gt;private: System::Void lst_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;Text=lst-&gt;Text;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-2480405897591149730?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/2480405897591149730/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=2480405897591149730' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/2480405897591149730'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/2480405897591149730'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/remove-items-in-listbox.html' title='Remove Items In ListBox'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_MeJernKB7_c/SE3Nr6etQrI/AAAAAAAAARQ/Df7iUtHH-sQ/s72-c/Remove+Items+In+ListBox.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-845103420375120813</id><published>2008-06-09T17:36:00.000-07:00</published><updated>2008-06-09T17:38:45.595-07:00</updated><title type='text'>Select Items in ListBox</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_MeJernKB7_c/SE3M9kyqtDI/AAAAAAAAARI/THwQTXurAAM/s1600-h/Select+Items+in+ListBox.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210045702157808690" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_MeJernKB7_c/SE3M9kyqtDI/AAAAAAAAARI/THwQTXurAAM/s320/Select+Items+in+ListBox.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My33 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::ListBox^ lst;&lt;br /&gt;protected:&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;lst = (gcnew System::Windows::Forms::ListBox());&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// lst&lt;br /&gt;//&lt;br /&gt;this-&gt;lst-&gt;FormattingEnabled = true;&lt;br /&gt;this-&gt;lst-&gt;Items-&gt;AddRange(gcnew cli::array&lt;&gt;(8) {L"Item 1", L"Item 2", L"Item 3", L"Item 4", L"Item 5",&lt;br /&gt;L"Item 6", L"Item 7", L"Item 8"});&lt;br /&gt;this-&gt;lst-&gt;Location = System::Drawing::Point(12, 13);&lt;br /&gt;this-&gt;lst-&gt;Name = L"lst";&lt;br /&gt;this-&gt;lst-&gt;Size = System::Drawing::Size(266, 121);&lt;br /&gt;this-&gt;lst-&gt;TabIndex = 0;&lt;br /&gt;this-&gt;lst-&gt;SelectedIndexChanged += gcnew System::EventHandler(this, &amp;amp;Form1::lst_SelectedIndexChanged);&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(292, 144);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;lst);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Select Items in ListBox&lt;br /&gt;private: System::Void lst_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;Text=lst-&gt;Text;&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;Text="Select Items In ListBox";&lt;br /&gt;this-&gt;MaximizeBox=false;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-845103420375120813?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/845103420375120813/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=845103420375120813' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/845103420375120813'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/845103420375120813'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/select-items-in-listbox.html' title='Select Items in ListBox'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_MeJernKB7_c/SE3M9kyqtDI/AAAAAAAAARI/THwQTXurAAM/s72-c/Select+Items+in+ListBox.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-6492629332386036883</id><published>2008-06-09T17:34:00.000-07:00</published><updated>2008-06-09T17:36:31.739-07:00</updated><title type='text'>Add Items In ListBox</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_MeJernKB7_c/SE3MXTbKdTI/AAAAAAAAARA/R4JBn5Mo02Q/s1600-h/Add+Items+In+ListBox.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210045044660794674" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_MeJernKB7_c/SE3MXTbKdTI/AAAAAAAAARA/R4JBn5Mo02Q/s320/Add+Items+In+ListBox.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My32 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::ListBox^ lstAddItems;&lt;br /&gt;protected:&lt;br /&gt;private: System::Windows::Forms::TextBox^ txtAdd;&lt;br /&gt;private: System::Windows::Forms::Button^ BtnAdd;&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;lstAddItems = (gcnew System::Windows::Forms::ListBox());&lt;br /&gt;this-&gt;txtAdd = (gcnew System::Windows::Forms::TextBox());&lt;br /&gt;this-&gt;BtnAdd = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// lstAddItems&lt;br /&gt;//&lt;br /&gt;this-&gt;lstAddItems-&gt;FormattingEnabled = true;&lt;br /&gt;this-&gt;lstAddItems-&gt;Location = System::Drawing::Point(12, 14);&lt;br /&gt;this-&gt;lstAddItems-&gt;Name = L"lstAddItems";&lt;br /&gt;this-&gt;lstAddItems-&gt;Size = System::Drawing::Size(268, 199);&lt;br /&gt;this-&gt;lstAddItems-&gt;TabIndex = 0;&lt;br /&gt;//&lt;br /&gt;// txtAdd&lt;br /&gt;//&lt;br /&gt;this-&gt;txtAdd-&gt;Location = System::Drawing::Point(14, 220);&lt;br /&gt;this-&gt;txtAdd-&gt;Name = L"txtAdd";&lt;br /&gt;this-&gt;txtAdd-&gt;Size = System::Drawing::Size(265, 20);&lt;br /&gt;this-&gt;txtAdd-&gt;TabIndex = 1;&lt;br /&gt;//&lt;br /&gt;// BtnAdd&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnAdd-&gt;Location = System::Drawing::Point(16, 251);&lt;br /&gt;this-&gt;BtnAdd-&gt;Name = L"BtnAdd";&lt;br /&gt;this-&gt;BtnAdd-&gt;Size = System::Drawing::Size(262, 27);&lt;br /&gt;this-&gt;BtnAdd-&gt;TabIndex = 2;&lt;br /&gt;this-&gt;BtnAdd-&gt;Text = L"Add to List";&lt;br /&gt;this-&gt;BtnAdd-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnAdd-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnAdd_Click);&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(289, 285);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnAdd);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;txtAdd);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;lstAddItems);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;this-&gt;PerformLayout();&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Add Items In ListBox&lt;br /&gt;private: System::Void BtnAdd_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;lstAddItems-&gt;Items-&gt;Add(txtAdd-&gt;Text);&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;Text="Add Items in ListBox";&lt;br /&gt;this-&gt;MaximizeBox=false;&lt;br /&gt;txtAdd-&gt;Text="Add Items";&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-6492629332386036883?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/6492629332386036883/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=6492629332386036883' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/6492629332386036883'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/6492629332386036883'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/add-items-in-listbox.html' title='Add Items In ListBox'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_MeJernKB7_c/SE3MXTbKdTI/AAAAAAAAARA/R4JBn5Mo02Q/s72-c/Add+Items+In+ListBox.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-7871093005886866436</id><published>2008-06-09T17:32:00.001-07:00</published><updated>2008-06-09T17:34:23.383-07:00</updated><title type='text'>Draw Animation Line</title><content type='html'>&lt;a href="http://2.bp.blogspot.com/_MeJernKB7_c/SE3L6Np69NI/AAAAAAAAAQ4/2zPw31mgZ0I/s1600-h/Draw+Animation+Line.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210044544895874258" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_MeJernKB7_c/SE3L6Np69NI/AAAAAAAAAQ4/2zPw31mgZ0I/s320/Draw+Animation+Line.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My31 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::Timer^ t;&lt;br /&gt;private: System::Windows::Forms::Button^ BtnStart;&lt;br /&gt;protected:&lt;br /&gt;private: System::ComponentModel::IContainer^ components;&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;components = (gcnew System::ComponentModel::Container());&lt;br /&gt;this-&gt;t = (gcnew System::Windows::Forms::Timer(this-&gt;components));&lt;br /&gt;this-&gt;BtnStart = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// t&lt;br /&gt;//&lt;br /&gt;this-&gt;t-&gt;Interval = 1;&lt;br /&gt;this-&gt;t-&gt;Tick += gcnew System::EventHandler(this, &amp;amp;Form1::t_Tick);&lt;br /&gt;//&lt;br /&gt;// BtnStart&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnStart-&gt;Location = System::Drawing::Point(12, 12);&lt;br /&gt;this-&gt;BtnStart-&gt;Name = L"BtnStart";&lt;br /&gt;this-&gt;BtnStart-&gt;Size = System::Drawing::Size(111, 27);&lt;br /&gt;this-&gt;BtnStart-&gt;TabIndex = 0;&lt;br /&gt;this-&gt;BtnStart-&gt;Text = L"Start";&lt;br /&gt;this-&gt;BtnStart-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnStart-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnStart_Click);&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(292, 266);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnStart);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Draw Animation Line&lt;br /&gt;Graphics^G;&lt;br /&gt;Pen^HPen;&lt;br /&gt;Pen^HPen2;&lt;br /&gt;int cY1;&lt;br /&gt;int cY2;&lt;br /&gt;private: System::Void t_Tick(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;HPen=gcnew Pen(Color::Yellow,1);&lt;br /&gt;HPen2=gcnew Pen(Color::Blue,2);&lt;br /&gt;HPen-&gt;DashStyle=System::Drawing::Drawing2D::DashStyle::DashDot;&lt;br /&gt;HPen2-&gt;DashStyle=System::Drawing::Drawing2D::DashStyle::DashDotDot;&lt;br /&gt;cY1++;&lt;br /&gt;cY2--;&lt;br /&gt;G-&gt;DrawLine(HPen,0,cY1,500,cY1);&lt;br /&gt;G-&gt;DrawLine(HPen2,500,cY2,this-&gt;Width,cY2);&lt;br /&gt;}&lt;br /&gt;private: System::Void BtnStart_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;G-&gt;Clear(this-&gt;BackColor);&lt;br /&gt;cY2=this-&gt;Height;&lt;br /&gt;cY1=0;&lt;br /&gt;t-&gt;Enabled=true;&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;BackColor=Color::Black;&lt;br /&gt;this-&gt;Text="Draw Animation Line";&lt;br /&gt;this-&gt;FormBorderStyle=Windows::Forms::FormBorderStyle::FixedToolWindow;&lt;br /&gt;this-&gt;Left=0;&lt;br /&gt;this-&gt;Top=0;&lt;br /&gt;this-&gt;Width=Screen::PrimaryScreen-&gt;WorkingArea.Width;&lt;br /&gt;this-&gt;Height=Screen::PrimaryScreen-&gt;WorkingArea.Height;&lt;br /&gt;G=this-&gt;CreateGraphics();&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-7871093005886866436?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/7871093005886866436/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=7871093005886866436' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/7871093005886866436'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/7871093005886866436'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/draw-animation-line.html' title='Draw Animation Line'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_MeJernKB7_c/SE3L6Np69NI/AAAAAAAAAQ4/2zPw31mgZ0I/s72-c/Draw+Animation+Line.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-8171380814605354647</id><published>2008-06-09T17:28:00.001-07:00</published><updated>2008-06-09T17:32:02.559-07:00</updated><title type='text'>DrawLine With Mouse</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_MeJernKB7_c/SE3LZc-P35I/AAAAAAAAAQw/qw2wIhtqwzA/s1600-h/DrawLine+With+Mouse.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210043982071979922" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_MeJernKB7_c/SE3LZc-P35I/AAAAAAAAAQw/qw2wIhtqwzA/s320/DrawLine+With+Mouse.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My30 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(528, 326);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;MouseUp += gcnew System::Windows::Forms::MouseEventHandler(this, &amp;amp;Form1::Form1_MouseUp);&lt;br /&gt;this-&gt;MouseMove += gcnew System::Windows::Forms::MouseEventHandler(this, &amp;amp;Form1::Form1_MouseMove);&lt;br /&gt;this-&gt;MouseDown += gcnew System::Windows::Forms::MouseEventHandler(this, &amp;amp;Form1::Form1_MouseDown);&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//DrawLine With Mouse&lt;br /&gt;Graphics^G;&lt;br /&gt;Pen^HPen;&lt;br /&gt;bool BCheck;&lt;br /&gt;int TmpX;&lt;br /&gt;int TmpY;&lt;br /&gt;private: System::Void Form1_MouseDown(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) {&lt;br /&gt;BCheck=true;&lt;br /&gt;TmpX=e-&gt;X;&lt;br /&gt;TmpY=e-&gt;Y;&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_MouseMove(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) {&lt;br /&gt;if(BCheck==true)&lt;br /&gt;{&lt;br /&gt;if(e-&gt;Button==Windows::Forms::MouseButtons::Left)&lt;br /&gt;{&lt;br /&gt;G-&gt;Clear(this-&gt;BackColor);&lt;br /&gt;G-&gt;DrawLine(HPen,TmpX,TmpY,e-&gt;X,e-&gt;Y);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;G=this-&gt;CreateGraphics();&lt;br /&gt;HPen=gcnew Pen(Color::Yellow,1);&lt;br /&gt;HPen-&gt;DashStyle=System::Drawing::Drawing2D::DashStyle::Dot;&lt;br /&gt;this-&gt;BackColor=Color::Green;&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_MouseUp(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) {&lt;br /&gt;BCheck=false;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-8171380814605354647?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/8171380814605354647/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=8171380814605354647' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/8171380814605354647'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/8171380814605354647'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/drawline-with-mouse.html' title='DrawLine With Mouse'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_MeJernKB7_c/SE3LZc-P35I/AAAAAAAAAQw/qw2wIhtqwzA/s72-c/DrawLine+With+Mouse.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-1405198435712177278</id><published>2008-06-09T17:25:00.000-07:00</published><updated>2008-06-09T17:27:54.391-07:00</updated><title type='text'>Random RGB Color</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_MeJernKB7_c/SE3KL0ow29I/AAAAAAAAAQo/Kk4ArH4jHzE/s1600-h/Random+RGB+Color.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210042648394521554" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_MeJernKB7_c/SE3KL0ow29I/AAAAAAAAAQo/Kk4ArH4jHzE/s320/Random+RGB+Color.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My29 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::Button^ BtnShowRGB;&lt;br /&gt;protected:&lt;br /&gt;private: System::Windows::Forms::Button^ BRed;&lt;br /&gt;private: System::Windows::Forms::Button^ BtnGreen;&lt;br /&gt;private: System::Windows::Forms::Button^ BtnBlue;&lt;br /&gt;private: System::Windows::Forms::PictureBox^ PctResult;&lt;br /&gt;&lt;br /&gt;protected:&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;BtnShowRGB = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;BRed = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;BtnGreen = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;BtnBlue = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;PctResult = (gcnew System::Windows::Forms::PictureBox());&lt;br /&gt;(cli::safe_cast&lt;/span&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;span style="color:#ffffff;"&gt;(this-&gt;PctResult))-&gt;BeginInit();&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// BtnShowRGB&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnShowRGB-&gt;Location = System::Drawing::Point(12, 185);&lt;br /&gt;this-&gt;BtnShowRGB-&gt;Name = L"BtnShowRGB";&lt;br /&gt;this-&gt;BtnShowRGB-&gt;Size = System::Drawing::Size(145, 40);&lt;br /&gt;this-&gt;BtnShowRGB-&gt;TabIndex = 0;&lt;br /&gt;this-&gt;BtnShowRGB-&gt;Text = L"Show ColorRGB";&lt;br /&gt;this-&gt;BtnShowRGB-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnShowRGB-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnRandomRGB_Click);&lt;br /&gt;//&lt;br /&gt;// BRed&lt;br /&gt;//&lt;br /&gt;this-&gt;BRed-&gt;Location = System::Drawing::Point(12, 12);&lt;br /&gt;this-&gt;BRed-&gt;Name = L"BRed";&lt;br /&gt;this-&gt;BRed-&gt;Size = System::Drawing::Size(145, 42);&lt;br /&gt;this-&gt;BRed-&gt;TabIndex = 1;&lt;br /&gt;this-&gt;BRed-&gt;Text = L"Red";&lt;br /&gt;this-&gt;BRed-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BRed-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BRed_Click);&lt;br /&gt;//&lt;br /&gt;// BtnGreen&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnGreen-&gt;Location = System::Drawing::Point(12, 60);&lt;br /&gt;this-&gt;BtnGreen-&gt;Name = L"BtnGreen";&lt;br /&gt;this-&gt;BtnGreen-&gt;Size = System::Drawing::Size(145, 42);&lt;br /&gt;this-&gt;BtnGreen-&gt;TabIndex = 2;&lt;br /&gt;this-&gt;BtnGreen-&gt;Text = L"Green";&lt;br /&gt;this-&gt;BtnGreen-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnGreen-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnGreen_Click);&lt;br /&gt;//&lt;br /&gt;// BtnBlue&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnBlue-&gt;Location = System::Drawing::Point(12, 108);&lt;br /&gt;this-&gt;BtnBlue-&gt;Name = L"BtnBlue";&lt;br /&gt;this-&gt;BtnBlue-&gt;Size = System::Drawing::Size(145, 42);&lt;br /&gt;this-&gt;BtnBlue-&gt;TabIndex = 3;&lt;br /&gt;this-&gt;BtnBlue-&gt;Text = L"Blue";&lt;br /&gt;this-&gt;BtnBlue-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnBlue-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnBlue_Click);&lt;br /&gt;//&lt;br /&gt;// PctResult&lt;br /&gt;//&lt;br /&gt;this-&gt;PctResult-&gt;Location = System::Drawing::Point(168, 11);&lt;br /&gt;this-&gt;PctResult-&gt;Name = L"PctResult";&lt;br /&gt;this-&gt;PctResult-&gt;Size = System::Drawing::Size(369, 213);&lt;br /&gt;this-&gt;PctResult-&gt;TabIndex = 4;&lt;br /&gt;this-&gt;PctResult-&gt;TabStop = false;&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(550, 236);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;PctResult);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnBlue);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnGreen);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BRed);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnShowRGB);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;(cli::safe_cast&lt;/span&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;span style="color:#ffffff;"&gt;(this-&gt;PctResult))-&gt;EndInit();&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Random RGB Color&lt;br /&gt;int rRed;&lt;br /&gt;int rGreen;&lt;br /&gt;int rBlue;&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;MaximizeBox=false;&lt;br /&gt;this-&gt;BackColor=Color::Gray;&lt;br /&gt;this-&gt;Text="Random RGB Color = Red : "+rRed+" Green : "+rGreen+&lt;br /&gt;" Blue : "+rBlue;&lt;br /&gt;PctResult-&gt;BackColor=Color::Black;&lt;br /&gt;PctResult-&gt;BorderStyle=Windows::Forms::BorderStyle::Fixed3D;&lt;br /&gt;}&lt;br /&gt;private: System::Void BtnRandomRGB_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;PctResult-&gt;BackColor=Color::FromArgb(rRed,rGreen,rBlue);&lt;br /&gt;this-&gt;Text="Random RGB Color = Red : "+rRed+" Green : "+rGreen+&lt;br /&gt;" Blue : "+rBlue;&lt;br /&gt;}&lt;br /&gt;private: System::Void BRed_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;rRed=Random().Next(255);&lt;br /&gt;}&lt;br /&gt;private: System::Void BtnGreen_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;rGreen=Random().Next(255);&lt;br /&gt;}&lt;br /&gt;private: System::Void BtnBlue_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;rBlue=Random().Next(255);&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;br /&gt;&lt;?XML:NAMESPACE PREFIX = System /&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-1405198435712177278?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/1405198435712177278/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=1405198435712177278' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/1405198435712177278'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/1405198435712177278'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/random-rgb-color.html' title='Random RGB Color'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_MeJernKB7_c/SE3KL0ow29I/AAAAAAAAAQo/Kk4ArH4jHzE/s72-c/Random+RGB+Color.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-2321035202323458013</id><published>2008-06-09T17:19:00.000-07:00</published><updated>2008-06-09T17:23:03.258-07:00</updated><title type='text'>Get Color Pixel on Image</title><content type='html'>&lt;a href="http://2.bp.blogspot.com/_MeJernKB7_c/SE3JHcKl6GI/AAAAAAAAAQg/Eib8hv1__6U/s1600-h/Get+Color+Pixel+on+Image.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210041473594419298" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_MeJernKB7_c/SE3JHcKl6GI/AAAAAAAAAQg/Eib8hv1__6U/s320/Get+Color+Pixel+on+Image.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My28 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::PictureBox^ PctGetColor;&lt;br /&gt;protected:&lt;br /&gt;protected:&lt;br /&gt;protected:&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;PctGetColor = (gcnew System::Windows::Forms::PictureBox());&lt;br /&gt;(cli::safe_cast&lt;/span&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;span style="color:#ffffff;"&gt;(this-&gt;PctGetColor))-&gt;BeginInit();&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// PctGetColor&lt;br /&gt;//&lt;br /&gt;this-&gt;PctGetColor-&gt;Location = System::Drawing::Point(316, 1);&lt;br /&gt;this-&gt;PctGetColor-&gt;Name = L"PctGetColor";&lt;br /&gt;this-&gt;PctGetColor-&gt;Size = System::Drawing::Size(60, 44);&lt;br /&gt;this-&gt;PctGetColor-&gt;TabIndex = 0;&lt;br /&gt;this-&gt;PctGetColor-&gt;TabStop = false;&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(377, 322);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;PctGetColor);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Paint += gcnew System::Windows::Forms::PaintEventHandler(this, &amp;amp;Form1::Form1_Paint);&lt;br /&gt;this-&gt;MouseDown += gcnew System::Windows::Forms::MouseEventHandler(this, &amp;amp;Form1::Form1_MouseDown);&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;(cli::safe_cast&lt;/span&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;span style="color:#ffffff;"&gt;(this-&gt;PctGetColor))-&gt;EndInit();&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Get Color Pixel on Image&lt;br /&gt;Graphics^GetColor_Graphics;&lt;br /&gt;Bitmap^GetColor_Bitmap;&lt;br /&gt;Color KColor;&lt;br /&gt;private: System::Void Form1_MouseDown(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) {&lt;br /&gt;int cX;&lt;br /&gt;int cY;&lt;br /&gt;cX=e-&gt;X;&lt;br /&gt;cY=e-&gt;Y;&lt;br /&gt;if(e-&gt;Button==Windows::Forms::MouseButtons::Left)&lt;br /&gt;{&lt;br /&gt;KColor=GetColor_Bitmap-&gt;GetPixel(cX,cY);&lt;br /&gt;PctGetColor-&gt;BackColor=KColor;&lt;br /&gt;this-&gt;Text="Current X : "+cX+" Current Y : "+cY;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;PctGetColor-&gt;BorderStyle=Windows::Forms::BorderStyle::Fixed3D;&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e) {&lt;br /&gt;GetColor_Graphics=this-&gt;CreateGraphics();&lt;br /&gt;GetColor_Bitmap=gcnew Bitmap("C:\\Flower.Bmp");&lt;br /&gt;GetColor_Graphics-&gt;DrawImage(GetColor_Bitmap,0,0,400,400);&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;br /&gt;&lt;?XML:NAMESPACE PREFIX = System /&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-2321035202323458013?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/2321035202323458013/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=2321035202323458013' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/2321035202323458013'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/2321035202323458013'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/get-color-pixel-on-image.html' title='Get Color Pixel on Image'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_MeJernKB7_c/SE3JHcKl6GI/AAAAAAAAAQg/Eib8hv1__6U/s72-c/Get+Color+Pixel+on+Image.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-5354872664020712112</id><published>2008-06-09T16:43:00.000-07:00</published><updated>2008-06-09T17:25:32.619-07:00</updated><title type='text'>Gradient</title><content type='html'>&lt;a href="http://2.bp.blogspot.com/_MeJernKB7_c/SE3IhJdyeYI/AAAAAAAAAQY/PW03HeSdjuE/s1600-h/Gradient.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210040815739632002" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_MeJernKB7_c/SE3IhJdyeYI/AAAAAAAAAQY/PW03HeSdjuE/s320/Gradient.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My27 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::Button^ BtnGradient;&lt;br /&gt;protected:&lt;br /&gt;protected:&lt;br /&gt;protected:&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;BtnGradient = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// BtnGradient&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnGradient-&gt;Location = System::Drawing::Point(105, 279);&lt;br /&gt;this-&gt;BtnGradient-&gt;Name = L"BtnGradient";&lt;br /&gt;this-&gt;BtnGradient-&gt;Size = System::Drawing::Size(123, 43);&lt;br /&gt;this-&gt;BtnGradient-&gt;TabIndex = 0;&lt;br /&gt;this-&gt;BtnGradient-&gt;Text = L"Gradient";&lt;br /&gt;this-&gt;BtnGradient-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnGradient-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnGradient_Click);&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(306, 335);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnGradient);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Paint += gcnew System::Windows::Forms::PaintEventHandler(this, &amp;amp;Form1::Form1_Paint);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Gradient&lt;br /&gt;private: System::Void Form1_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e) {&lt;br /&gt;}&lt;br /&gt;private: System::Void BtnGradient_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;Graphics^g;&lt;br /&gt;g=this-&gt;CreateGraphics();&lt;br /&gt;System::Drawing::Drawing2D::LinearGradientBrush^b;&lt;br /&gt;b=gcnew System::Drawing::Drawing2D::LinearGradientBrush(ClientRectangle,Color::Red,Color::Yellow,System::Drawing::Drawing2D::LinearGradientMode::BackwardDiagonal);&lt;br /&gt;g-&gt;FillRectangle(b,Rectangle(0,0,this-&gt;Width,this-&gt;Height));&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-5354872664020712112?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/5354872664020712112/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=5354872664020712112' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/5354872664020712112'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/5354872664020712112'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/gradient.html' title='Gradient'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_MeJernKB7_c/SE3IhJdyeYI/AAAAAAAAAQY/PW03HeSdjuE/s72-c/Gradient.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-5346083512246067734</id><published>2008-06-09T16:41:00.000-07:00</published><updated>2008-06-09T16:43:10.760-07:00</updated><title type='text'>Random</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_MeJernKB7_c/SE2_zfxvueI/AAAAAAAAAQQ/-VIIworZpnw/s1600-h/Random.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210031235361913314" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_MeJernKB7_c/SE2_zfxvueI/AAAAAAAAAQQ/-VIIworZpnw/s320/Random.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My26 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::Button^ BtnRandom;&lt;br /&gt;protected:&lt;br /&gt;protected:&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;BtnRandom = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// BtnRandom&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnRandom-&gt;Location = System::Drawing::Point(31, 22);&lt;br /&gt;this-&gt;BtnRandom-&gt;Name = L"BtnRandom";&lt;br /&gt;this-&gt;BtnRandom-&gt;Size = System::Drawing::Size(190, 56);&lt;br /&gt;this-&gt;BtnRandom-&gt;TabIndex = 0;&lt;br /&gt;this-&gt;BtnRandom-&gt;Text = L"Random";&lt;br /&gt;this-&gt;BtnRandom-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnRandom-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnRandom_Click);&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(237, 98);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnRandom);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Random&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;BackColor=Color::BlueViolet;&lt;br /&gt;this-&gt;MaximizeBox=false;&lt;br /&gt;this-&gt;Text="Random : ";&lt;br /&gt;BtnRandom-&gt;BackColor=Color::Black;&lt;br /&gt;BtnRandom-&gt;ForeColor=Color::White;&lt;br /&gt;}&lt;br /&gt;private: System::Void BtnRandom_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;int i;&lt;br /&gt;i=Random().Next(100);&lt;br /&gt;this-&gt;Text="Random : "+i.ToString();&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-5346083512246067734?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/5346083512246067734/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=5346083512246067734' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/5346083512246067734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/5346083512246067734'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/random.html' title='Random'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_MeJernKB7_c/SE2_zfxvueI/AAAAAAAAAQQ/-VIIworZpnw/s72-c/Random.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-4830817610764452437</id><published>2008-06-09T16:35:00.000-07:00</published><updated>2008-06-09T16:40:31.903-07:00</updated><title type='text'>DrawEllipse</title><content type='html'>&lt;a href="http://1.bp.blogspot.com/_MeJernKB7_c/SE2_LjLHGaI/AAAAAAAAAQI/iZjTNIPddE4/s1600-h/DrawEllipse.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210030549078841762" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_MeJernKB7_c/SE2_LjLHGaI/AAAAAAAAAQI/iZjTNIPddE4/s320/DrawEllipse.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My15 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(292, 266);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Paint += gcnew System::Windows::Forms::PaintEventHandler(this, &amp;amp;Form1::Form1_Paint);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//DrawEllipse&lt;br /&gt;private: System::Void Form1_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e) {&lt;br /&gt;Graphics^DrawText_Graphics;&lt;br /&gt;Brushes^HBrush;&lt;br /&gt;Pen^HPen;&lt;br /&gt;DrawText_Graphics=this-&gt;CreateGraphics();&lt;br /&gt;HPen=gcnew Pen(Color::White,4);&lt;br /&gt;HPen-&gt;DashStyle=Drawing2D::DashStyle::Dot;&lt;br /&gt;DrawText_Graphics-&gt;DrawEllipse(HPen,10,10,270,240);&lt;br /&gt;this-&gt;Text="DrawEllipse";&lt;br /&gt;this-&gt;BackColor=Color::Blue;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-4830817610764452437?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/4830817610764452437/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=4830817610764452437' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/4830817610764452437'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/4830817610764452437'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/drawellipse.html' title='DrawEllipse'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_MeJernKB7_c/SE2_LjLHGaI/AAAAAAAAAQI/iZjTNIPddE4/s72-c/DrawEllipse.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-5640460351193606186</id><published>2008-06-09T16:33:00.000-07:00</published><updated>2008-06-09T16:35:39.838-07:00</updated><title type='text'>FontDialog</title><content type='html'>&lt;a href="http://2.bp.blogspot.com/_MeJernKB7_c/SE2-DjeU4UI/AAAAAAAAAQA/HqwtZj6B23o/s1600-h/FontDialog.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210029312208855362" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_MeJernKB7_c/SE2-DjeU4UI/AAAAAAAAAQA/HqwtZj6B23o/s320/FontDialog.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My25 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::Button^ BtnOpenFont;&lt;br /&gt;private: System::Windows::Forms::TextBox^ t;&lt;br /&gt;private: System::Windows::Forms::FontDialog^ f;&lt;br /&gt;protected:&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;BtnOpenFont = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;t = (gcnew System::Windows::Forms::TextBox());&lt;br /&gt;this-&gt;f = (gcnew System::Windows::Forms::FontDialog());&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// BtnOpenFont&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnOpenFont-&gt;Location = System::Drawing::Point(16, 209);&lt;br /&gt;this-&gt;BtnOpenFont-&gt;Name = L"BtnOpenFont";&lt;br /&gt;this-&gt;BtnOpenFont-&gt;Size = System::Drawing::Size(264, 49);&lt;br /&gt;this-&gt;BtnOpenFont-&gt;TabIndex = 0;&lt;br /&gt;this-&gt;BtnOpenFont-&gt;Text = L"Open Font";&lt;br /&gt;this-&gt;BtnOpenFont-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnOpenFont-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnOpenFont_Click);&lt;br /&gt;//&lt;br /&gt;// t&lt;br /&gt;//&lt;br /&gt;this-&gt;t-&gt;Location = System::Drawing::Point(22, 12);&lt;br /&gt;this-&gt;t-&gt;Multiline = true;&lt;br /&gt;this-&gt;t-&gt;Name = L"t";&lt;br /&gt;this-&gt;t-&gt;Size = System::Drawing::Size(258, 182);&lt;br /&gt;this-&gt;t-&gt;TabIndex = 1;&lt;br /&gt;this-&gt;t-&gt;Text = L"fdasfdasf";&lt;br /&gt;//&lt;br /&gt;// f&lt;br /&gt;//&lt;br /&gt;this-&gt;f-&gt;Apply += gcnew System::EventHandler(this, &amp;amp;Form1::f_Apply);&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(292, 266);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;t);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnOpenFont);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;this-&gt;PerformLayout();&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//FontDialog&lt;br /&gt;private: System::Void BtnOpenFont_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;f-&gt;ShowApply=true;&lt;br /&gt;f-&gt;ShowColor=true;&lt;br /&gt;f-&gt;ShowEffects=true;&lt;br /&gt;if(f-&gt;ShowDialog()==System::Windows::Forms::DialogResult::Cancel)&lt;br /&gt;{&lt;br /&gt;t-&gt;ResetForeColor();&lt;br /&gt;t-&gt;ResetFont();&lt;br /&gt;}else{&lt;br /&gt;t-&gt;Font::set(f-&gt;Font::get());&lt;br /&gt;t-&gt;ForeColor::set(f-&gt;Color::get());&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;}&lt;br /&gt;private: System::Void f_Apply(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;t-&gt;Font::set(f-&gt;Font::get());&lt;br /&gt;t-&gt;ForeColor::set(f-&gt;Color::get());&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-5640460351193606186?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/5640460351193606186/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=5640460351193606186' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/5640460351193606186'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/5640460351193606186'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/fontdialog.html' title='FontDialog'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_MeJernKB7_c/SE2-DjeU4UI/AAAAAAAAAQA/HqwtZj6B23o/s72-c/FontDialog.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-3343784993867407525</id><published>2008-06-09T16:29:00.000-07:00</published><updated>2008-06-09T16:32:48.940-07:00</updated><title type='text'>Move Character</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_MeJernKB7_c/SE29XJcgxdI/AAAAAAAAAP4/tF3bnT7bqyk/s1600-h/Move+Character.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210028549307680210" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_MeJernKB7_c/SE29XJcgxdI/AAAAAAAAAP4/tF3bnT7bqyk/s320/Move+Character.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My24 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;private: System::ComponentModel::IContainer^ components;&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(632, 584);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;KeyDown += gcnew System::Windows::Forms::KeyEventHandler(this, &amp;amp;Form1::Form1_KeyDown);&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Move Character&lt;br /&gt;int Ch_X;&lt;br /&gt;int Ch_Y;&lt;br /&gt;Graphics^BoardGraphics;&lt;br /&gt;Graphics^HandleToBoardGraphics;&lt;br /&gt;Bitmap^BoardBmp;&lt;br /&gt;Bitmap^Grass;&lt;br /&gt;Bitmap^Floor;&lt;br /&gt;void DrawCharacter(String^StrFilename,int ChX,int ChY)&lt;br /&gt;{&lt;br /&gt;BoardGraphics=this-&gt;CreateGraphics();&lt;br /&gt;Grass=gcnew Bitmap(StrFilename);&lt;br /&gt;BoardBmp=gcnew Bitmap("C:\\Bkg.Bmp");&lt;br /&gt;Floor=gcnew Bitmap("C:\\Bkg.PNG");&lt;br /&gt;Grass-&gt;MakeTransparent(Color::Black);&lt;br /&gt;BoardBmp-&gt;MakeTransparent(Color::Black);&lt;br /&gt;HandleToBoardGraphics=Graphics::FromImage(BoardBmp);&lt;br /&gt;HandleToBoardGraphics-&gt;Clear(this-&gt;BackColor);&lt;br /&gt;HandleToBoardGraphics-&gt;DrawImage(Floor,0,0,this-&gt;Width,this-&gt;Height);&lt;br /&gt;HandleToBoardGraphics-&gt;DrawImage(Grass,ChX,ChY);&lt;br /&gt;BoardGraphics-&gt;DrawImage(BoardBmp,0,0);&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;Text="Move Character";&lt;br /&gt;this-&gt;MaximizeBox=false;&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_KeyDown(System::Object^ sender, System::Windows::Forms::KeyEventArgs^ e) {&lt;br /&gt;if(e-&gt;KeyCode==Windows::Forms::Keys::Down)&lt;br /&gt;{&lt;br /&gt;Ch_Y=Ch_Y+=10;&lt;br /&gt;DrawCharacter("C:\\Character.Bmp",Ch_X,Ch_Y);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-3343784993867407525?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/3343784993867407525/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=3343784993867407525' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/3343784993867407525'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/3343784993867407525'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/move-character.html' title='Move Character'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_MeJernKB7_c/SE29XJcgxdI/AAAAAAAAAP4/tF3bnT7bqyk/s72-c/Move+Character.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-8387432313058015682</id><published>2008-06-09T16:26:00.000-07:00</published><updated>2008-06-09T16:29:04.306-07:00</updated><title type='text'>Draw Character</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_MeJernKB7_c/SE28iAejtSI/AAAAAAAAAPw/Lk1Omm47XIk/s1600-h/Draw+Character.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5210027636367275298" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_MeJernKB7_c/SE28iAejtSI/AAAAAAAAAPw/Lk1Omm47XIk/s320/Draw+Character.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My23 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;using namespace System::IO;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(292, 266);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Paint += gcnew System::Windows::Forms::PaintEventHandler(this, &amp;amp;Form1::Form1_Paint);&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Draw Character&lt;br /&gt;private: System::Void Form1_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e) {&lt;br /&gt;Graphics^G;&lt;br /&gt;Bitmap^B;&lt;br /&gt;B=gcnew Bitmap("C:\\Character.Bmp");&lt;br /&gt;B-&gt;MakeTransparent(Color::Black);&lt;br /&gt;G=this-&gt;CreateGraphics();&lt;br /&gt;G-&gt;DrawImage(B,50,50);&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;Text="Draw Character";&lt;br /&gt;this-&gt;MaximizeBox=false;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-8387432313058015682?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/8387432313058015682/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=8387432313058015682' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/8387432313058015682'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/8387432313058015682'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/draw-character.html' title='Draw Character'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_MeJernKB7_c/SE28iAejtSI/AAAAAAAAAPw/Lk1Omm47XIk/s72-c/Draw+Character.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-7729705899335571838</id><published>2008-06-08T05:58:00.000-07:00</published><updated>2008-06-08T06:01:42.741-07:00</updated><title type='text'>Image Format</title><content type='html'>&lt;span style="color:#ffff00;"&gt;The executable image format is PE32+. Executable images (both DLLs and EXEs) are restricted to a maximum size of 2 gigabytes, so relative addressing with a 32-bit displacement can be used to address static image data. This data includes the import address table, string constants, static global data, and so on.&lt;br /&gt;Visual C++ libraries are side-by-side assembliesVisual Studio 2005 installs Visual C++ libraries as shared side-by-side assemblies. By default, all applications built with Visual Studio 2005 are built as isolated applications with a manifest either embedded as a resource, or accompanying the final binary as an external file. In order to ensure that your Visual C++ application will run on a computer without Visual C++ installed, you may have to redistribute Visual Redistributing Visual C++ librariesThere are two recommended ways to redistribute Visual C++ DLLs. First, you can use Visual C++ Redistributable Merge Modules to install Visual C++ assemblies as shared side-by-side assemblies. Alternatively, you can install a particular Visual C++ assembly as a private assembly for the application using files provide in the Program Files\Microsoft Visual Studio 8\VC\Redist directory.&lt;br /&gt;Note On Windows Server 2000, Windows 95 and Windows 98, the only recommended and supported way to redistribute Visual C++ libraries is by using Redistributable Merge Modules.&lt;br /&gt;When installing Visual C++ assemblies using redistributable merge modules, the assemblies are deployed as shared side-by-side assemblies into the native assembly cache (WinSxS folder). Access to this folder requires that the installer application be run by a user with administrative rights.&lt;br /&gt;If an installation is run by a user who does not have administrative rights, the installation fails to deploy the Visual C++ assemblies and the application will not run. Also, some products may allow installation on a per-user basis, but merge modules install libraries into shared locations and impact all users of the system. In both these and similar scenarios, the supported technique is to install the required assemblies as private side-by-side assemblies for a particular user's application.&lt;br /&gt;With this technique, it is enough to copy a folder with DLLs and manifests for dependent assemblies to the application's local folder. The operating system's loader, when executing the application, still looks for dependent assemblies in the WinSxS folder first; however when a corresponding assembly cannot be found, the loader loads a private assembly from this sub-directory. More details on this can be found in Redistributing Visual C++ Files.&lt;br /&gt;Manifest requiredIt is not supported to redistribute C/C++ applications that are built without a manifest. Visual C++ libraries cannot be used by C/C++ applications without a manifest binding the application to these library. All C/C++ programs built in Visual C++ 2005 have to include a manifest describing their dependencies on Visual C++ libraries. This is the default setup of projects in Visual Studio and the default behavior of the linker building the final binary from object code.&lt;br /&gt;Applications that expect dependent DLLs to be present in either the application-local folder, or in a folder indicated by an environment variable may also be vulnerable to security-related exploits. It is also more difficult to service such applications after they have been deployed.&lt;br /&gt;Prefer dynamic linking over static linkingIt is not recommended to redistribute C/C++ applications that statically link to Visual C++ libraries. It is often mistakenly assumed that by statically linking your program to Visual C++ libraries it is possible to significantly improve the performance of an application. However the impact on performance of dynamically loading Visual C++ libraries is insignificant in almost all cases. Furthermore, static linking does not allow for servicing the application and its dependent libraries by either the application's author or Microsoft. For example, consider an application that is statically linked to a particular library, running on a client computer with a new version of this library. The application still uses code from the previous version of this library, and does not benefit from library improvements, such as security enhancements. Authors of C/C++ applications are strongly advised to think through the servicing scenario before deciding to statically link to dependent libraries, and use dynamic linking whenever possible.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-7729705899335571838?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/7729705899335571838/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=7729705899335571838' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/7729705899335571838'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/7729705899335571838'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/image-format.html' title='Image Format'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-7395294255492121287</id><published>2008-06-08T05:53:00.000-07:00</published><updated>2008-06-08T05:58:01.747-07:00</updated><title type='text'>Using FromArgb In Class Color</title><content type='html'>&lt;a href="http://2.bp.blogspot.com/_MeJernKB7_c/SEvW8xABvCI/AAAAAAAAAPo/0jRBwR1k7ug/s1600-h/Using+FromArgb+In+Class+Color.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209493733418056738" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_MeJernKB7_c/SEvW8xABvCI/AAAAAAAAAPo/0jRBwR1k7ug/s320/Using+FromArgb+In+Class+Color.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My22 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::Button^ BtnRed;&lt;br /&gt;protected:&lt;br /&gt;private: System::Windows::Forms::Button^ BtnGreen;&lt;br /&gt;private: System::Windows::Forms::Button^ BtnBlue;&lt;br /&gt;private: System::Windows::Forms::Button^ BtnMix;&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;BtnRed = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;BtnGreen = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;BtnBlue = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;BtnMix = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// BtnRed&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnRed-&gt;Location = System::Drawing::Point(12, 22);&lt;br /&gt;this-&gt;BtnRed-&gt;Name = L"BtnRed";&lt;br /&gt;this-&gt;BtnRed-&gt;Size = System::Drawing::Size(66, 35);&lt;br /&gt;this-&gt;BtnRed-&gt;TabIndex = 0;&lt;br /&gt;this-&gt;BtnRed-&gt;Text = L"Red";&lt;br /&gt;this-&gt;BtnRed-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnRed-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnRed_Click);&lt;br /&gt;//&lt;br /&gt;// BtnGreen&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnGreen-&gt;Location = System::Drawing::Point(84, 22);&lt;br /&gt;this-&gt;BtnGreen-&gt;Name = L"BtnGreen";&lt;br /&gt;this-&gt;BtnGreen-&gt;Size = System::Drawing::Size(66, 35);&lt;br /&gt;this-&gt;BtnGreen-&gt;TabIndex = 1;&lt;br /&gt;this-&gt;BtnGreen-&gt;Text = L"Green";&lt;br /&gt;this-&gt;BtnGreen-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnGreen-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnGreen_Click);&lt;br /&gt;//&lt;br /&gt;// BtnBlue&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnBlue-&gt;Location = System::Drawing::Point(156, 22);&lt;br /&gt;this-&gt;BtnBlue-&gt;Name = L"BtnBlue";&lt;br /&gt;this-&gt;BtnBlue-&gt;Size = System::Drawing::Size(66, 35);&lt;br /&gt;this-&gt;BtnBlue-&gt;TabIndex = 2;&lt;br /&gt;this-&gt;BtnBlue-&gt;Text = L"Blue";&lt;br /&gt;this-&gt;BtnBlue-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnBlue-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnBlue_Click);&lt;br /&gt;//&lt;br /&gt;// BtnMix&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnMix-&gt;Location = System::Drawing::Point(228, 22);&lt;br /&gt;this-&gt;BtnMix-&gt;Name = L"BtnMix";&lt;br /&gt;this-&gt;BtnMix-&gt;Size = System::Drawing::Size(66, 35);&lt;br /&gt;this-&gt;BtnMix-&gt;TabIndex = 3;&lt;br /&gt;this-&gt;BtnMix-&gt;Text = L"Mix Color";&lt;br /&gt;this-&gt;BtnMix-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnMix-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnMix_Click);&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(304, 78);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnMix);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnBlue);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnGreen);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnRed);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Using FromArgb In Class Color&lt;br /&gt;private: System::Void BtnRed_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;BtnRed-&gt;BackColor=Color::FromArgb(255,0,0);&lt;br /&gt;}&lt;br /&gt;private: System::Void BtnGreen_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;BtnGreen-&gt;BackColor=Color::FromArgb(0,255,0);&lt;br /&gt;}&lt;br /&gt;private: System::Void BtnBlue_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;BtnBlue-&gt;BackColor=Color::FromArgb(0,0,255);&lt;br /&gt;}&lt;br /&gt;private: System::Void BtnMix_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;BtnMix-&gt;BackColor=Color::FromArgb(180,150,96);&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;Text="Using FromArgb In Class Color";&lt;br /&gt;this-&gt;MaximizeBox=false;&lt;br /&gt;this-&gt;BackColor=Color::Yellow;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-7395294255492121287?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/7395294255492121287/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=7395294255492121287' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/7395294255492121287'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/7395294255492121287'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/using-fromargb-in-class-color.html' title='Using FromArgb In Class Color'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_MeJernKB7_c/SEvW8xABvCI/AAAAAAAAAPo/0jRBwR1k7ug/s72-c/Using+FromArgb+In+Class+Color.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-6082546432797832115</id><published>2008-06-08T05:50:00.000-07:00</published><updated>2008-06-08T05:52:51.814-07:00</updated><title type='text'>Open Bitmap File</title><content type='html'>&lt;a href="http://1.bp.blogspot.com/_MeJernKB7_c/SEvV75WMlBI/AAAAAAAAAPg/BZvZbB5Rols/s1600-h/Open+Bitmap+File.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209492618967028754" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_MeJernKB7_c/SEvV75WMlBI/AAAAAAAAAPg/BZvZbB5Rols/s320/Open+Bitmap+File.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My21 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::Button^ BtnOpenBitmap;&lt;br /&gt;protected:&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;BtnOpenBitmap = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// BtnOpenBitmap&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnOpenBitmap-&gt;Location = System::Drawing::Point(12, 205);&lt;br /&gt;this-&gt;BtnOpenBitmap-&gt;Name = L"BtnOpenBitmap";&lt;br /&gt;this-&gt;BtnOpenBitmap-&gt;Size = System::Drawing::Size(268, 53);&lt;br /&gt;this-&gt;BtnOpenBitmap-&gt;TabIndex = 0;&lt;br /&gt;this-&gt;BtnOpenBitmap-&gt;Text = L"Open Bitmap";&lt;br /&gt;this-&gt;BtnOpenBitmap-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnOpenBitmap-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnOpenBitmap_Click);&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(292, 270);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnOpenBitmap);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load_1);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Open Bitmap File&lt;br /&gt;String^StrFilename;&lt;br /&gt;private: System::Void BtnOpenBitmap_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;OpenFileDialog^OpenBitmap;&lt;br /&gt;OpenBitmap=gcnew OpenFileDialog();&lt;br /&gt;OpenBitmap-&gt;Filter="*.bmp*.bmp";&lt;br /&gt;OpenBitmap-&gt;ShowDialog();&lt;br /&gt;StrFilename=OpenBitmap-&gt;FileName;&lt;br /&gt;this-&gt;Text=StrFilename;&lt;br /&gt;Graphics^OpenBitmap_Graphics;&lt;br /&gt;Bitmap^OpenBitmap_Bitmap;&lt;br /&gt;OpenBitmap_Bitmap=gcnew Bitmap(StrFilename);&lt;br /&gt;OpenBitmap_Graphics=this-&gt;CreateGraphics();&lt;br /&gt;OpenBitmap_Graphics-&gt;DrawImage(OpenBitmap_Bitmap,0,0);&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Load_1(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;Text="OpenFileDialog";&lt;br /&gt;this-&gt;BackColor=Color::Bisque;&lt;br /&gt;this-&gt;MaximizeBox=false;&lt;br /&gt;BtnOpenBitmap-&gt;BackColor=Color::Red;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-6082546432797832115?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/6082546432797832115/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=6082546432797832115' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/6082546432797832115'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/6082546432797832115'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/open-bitmap-file.html' title='Open Bitmap File'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_MeJernKB7_c/SEvV75WMlBI/AAAAAAAAAPg/BZvZbB5Rols/s72-c/Open+Bitmap+File.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-4839956571439304728</id><published>2008-06-08T05:44:00.000-07:00</published><updated>2008-06-08T05:49:57.110-07:00</updated><title type='text'>OpenFileDialog</title><content type='html'>&lt;a href="http://1.bp.blogspot.com/_MeJernKB7_c/SEvVPiuppaI/AAAAAAAAAPY/rKBzZpDlPgU/s1600-h/OpenFileDialog.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209491856981337506" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_MeJernKB7_c/SEvVPiuppaI/AAAAAAAAAPY/rKBzZpDlPgU/s320/OpenFileDialog.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My20 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::Button^ BtnOpenDialog;&lt;br /&gt;protected:&lt;br /&gt;protected:&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;BtnOpenDialog = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// BtnOpenDialog&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnOpenDialog-&gt;Location = System::Drawing::Point(28, 173);&lt;br /&gt;this-&gt;BtnOpenDialog-&gt;Name = L"BtnOpenDialog";&lt;br /&gt;this-&gt;BtnOpenDialog-&gt;Size = System::Drawing::Size(232, 67);&lt;br /&gt;this-&gt;BtnOpenDialog-&gt;TabIndex = 0;&lt;br /&gt;this-&gt;BtnOpenDialog-&gt;Text = L"Open Dialog";&lt;br /&gt;this-&gt;BtnOpenDialog-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnOpenDialog-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnOpenDialog_Click);&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(292, 266);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnOpenDialog);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//OpenFileDialog&lt;br /&gt;private: System::Void BtnOpenDialog_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;OpenFileDialog^op;&lt;br /&gt;op=gcnew OpenFileDialog();&lt;br /&gt;op-&gt;ShowDialog();&lt;br /&gt;this-&gt;Text=op-&gt;FileName;&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;Text="OpenFileDialog";&lt;br /&gt;this-&gt;BackColor=Color::Azure;&lt;br /&gt;this-&gt;MaximizeBox=false;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-4839956571439304728?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/4839956571439304728/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=4839956571439304728' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/4839956571439304728'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/4839956571439304728'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/openfiledialog.html' title='OpenFileDialog'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_MeJernKB7_c/SEvVPiuppaI/AAAAAAAAAPY/rKBzZpDlPgU/s72-c/OpenFileDialog.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-4758498880254827650</id><published>2008-06-08T05:39:00.000-07:00</published><updated>2008-06-08T05:42:38.644-07:00</updated><title type='text'>Draw FillRectangle</title><content type='html'>&lt;a href="http://1.bp.blogspot.com/_MeJernKB7_c/SEvTZqJ9rWI/AAAAAAAAAPI/AlOvCAeEx_0/s1600-h/Draw+FillRectangle.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209489831750380898" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_MeJernKB7_c/SEvTZqJ9rWI/AAAAAAAAAPI/AlOvCAeEx_0/s320/Draw+FillRectangle.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My19 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(347, 319);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Paint += gcnew System::Windows::Forms::PaintEventHandler(this, &amp;amp;Form1::Form1_Paint);&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Draw FillRectangle&lt;br /&gt;private: System::Void Form1_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e) {&lt;br /&gt;Graphics^g;&lt;br /&gt;g=this-&gt;CreateGraphics();&lt;br /&gt;g-&gt;FillRectangle(Brushes::Blue,10,10,330,300);&lt;br /&gt;g-&gt;FillRectangle(Brushes::Yellow,50,50,250,230);&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;Text="Draw FillRectangle";&lt;br /&gt;this-&gt;BackColor=Color::Red;&lt;br /&gt;this-&gt;MaximizeBox=false;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-4758498880254827650?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/4758498880254827650/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=4758498880254827650' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/4758498880254827650'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/4758498880254827650'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/draw-fillrectangle.html' title='Draw FillRectangle'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_MeJernKB7_c/SEvTZqJ9rWI/AAAAAAAAAPI/AlOvCAeEx_0/s72-c/Draw+FillRectangle.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-7176020236129145340</id><published>2008-06-08T05:37:00.000-07:00</published><updated>2008-06-08T05:39:00.826-07:00</updated><title type='text'>StretchImage</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_MeJernKB7_c/SEvSr75WWAI/AAAAAAAAAPA/uguXTcP6EzA/s1600-h/StretchImage.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209489046238550018" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_MeJernKB7_c/SEvSr75WWAI/AAAAAAAAAPA/uguXTcP6EzA/s320/StretchImage.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My18 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(672, 544);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Paint += gcnew System::Windows::Forms::PaintEventHandler(this, &amp;amp;Form1::Form1_Paint);&lt;br /&gt;this-&gt;Resize += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Resize);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//StretchImage&lt;br /&gt;Graphics^G;&lt;br /&gt;Bitmap^B;&lt;br /&gt;void StretchImage()&lt;br /&gt;{&lt;br /&gt;G=this-&gt;CreateGraphics();&lt;br /&gt;B=gcnew Bitmap("C:\\Flower.Bmp");&lt;br /&gt;G-&gt;DrawImage(B,0,0,this-&gt;Width,this-&gt;Height);&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e) {&lt;br /&gt;StretchImage();&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Resize(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;StretchImage();&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-7176020236129145340?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/7176020236129145340/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=7176020236129145340' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/7176020236129145340'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/7176020236129145340'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/stretchimage.html' title='StretchImage'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_MeJernKB7_c/SEvSr75WWAI/AAAAAAAAAPA/uguXTcP6EzA/s72-c/StretchImage.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-3594336019037991890</id><published>2008-06-08T05:33:00.000-07:00</published><updated>2008-06-08T05:35:46.777-07:00</updated><title type='text'>Rotate Image</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_MeJernKB7_c/SEvR6_QbFAI/AAAAAAAAAO4/RHctgcqJ2yo/s1600-h/Rotate+Image.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209488205327045634" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_MeJernKB7_c/SEvR6_QbFAI/AAAAAAAAAO4/RHctgcqJ2yo/s320/Rotate+Image.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My17 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::Button^ BtnShowImage;&lt;br /&gt;protected:&lt;br /&gt;private: System::Windows::Forms::Button^ BtnRotateImage;&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;BtnShowImage = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;BtnRotateImage = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// BtnShowImage&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnShowImage-&gt;Location = System::Drawing::Point(12, 386);&lt;br /&gt;this-&gt;BtnShowImage-&gt;Name = L"BtnShowImage";&lt;br /&gt;this-&gt;BtnShowImage-&gt;Size = System::Drawing::Size(240, 42);&lt;br /&gt;this-&gt;BtnShowImage-&gt;TabIndex = 0;&lt;br /&gt;this-&gt;BtnShowImage-&gt;Text = L"Show Image";&lt;br /&gt;this-&gt;BtnShowImage-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnShowImage-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnShowImage_Click);&lt;br /&gt;//&lt;br /&gt;// BtnRotateImage&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnRotateImage-&gt;Location = System::Drawing::Point(258, 386);&lt;br /&gt;this-&gt;BtnRotateImage-&gt;Name = L"BtnRotateImage";&lt;br /&gt;this-&gt;BtnRotateImage-&gt;Size = System::Drawing::Size(240, 42);&lt;br /&gt;this-&gt;BtnRotateImage-&gt;TabIndex = 1;&lt;br /&gt;this-&gt;BtnRotateImage-&gt;Text = L"RotateImage";&lt;br /&gt;this-&gt;BtnRotateImage-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnRotateImage-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnRotateImage_Click);&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(506, 440);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnRotateImage);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnShowImage);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Rotate Image&lt;br /&gt;Graphics^RotateImage_Graphics;&lt;br /&gt;Bitmap^RotateImage_Bitmap;&lt;br /&gt;void cDrawImage()&lt;br /&gt;{&lt;br /&gt;RotateImage_Bitmap=gcnew Bitmap("C:\\Flower.Bmp");&lt;br /&gt;RotateImage_Graphics-&gt;DrawImage(RotateImage_Bitmap,100,50,300,300);&lt;br /&gt;}&lt;br /&gt;private: System::Void BtnShowImage_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;cDrawImage();&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;RotateImage_Graphics=this-&gt;CreateGraphics();&lt;br /&gt;this-&gt;Text="RotateImage";&lt;br /&gt;this-&gt;MaximizeBox=false;&lt;br /&gt;this-&gt;BackColor=Color::Red;&lt;br /&gt;}&lt;br /&gt;private: System::Void BtnRotateImage_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;int cAngle;&lt;br /&gt;cAngle+=5;&lt;br /&gt;RotateImage_Graphics-&gt;RotateTransform(cAngle);&lt;br /&gt;RotateImage_Graphics-&gt;Clear(this-&gt;BackColor);&lt;br /&gt;cDrawImage();&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-3594336019037991890?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/3594336019037991890/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=3594336019037991890' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/3594336019037991890'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/3594336019037991890'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/rotate-image.html' title='Rotate Image'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_MeJernKB7_c/SEvR6_QbFAI/AAAAAAAAAO4/RHctgcqJ2yo/s72-c/Rotate+Image.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-5935956983902147976</id><published>2008-06-08T05:26:00.000-07:00</published><updated>2008-06-08T05:33:15.093-07:00</updated><title type='text'>Show Image On Form</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_MeJernKB7_c/SEvRVM82DnI/AAAAAAAAAOw/OogEBxjArGM/s1600-h/Show+Image+On+Form.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209487556167994994" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_MeJernKB7_c/SEvRVM82DnI/AAAAAAAAAOw/OogEBxjArGM/s320/Show+Image+On+Form.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My16 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::Button^ BtnShowImage;&lt;br /&gt;protected:&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;BtnShowImage = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// BtnShowImage&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnShowImage-&gt;Location = System::Drawing::Point(12, 270);&lt;br /&gt;this-&gt;BtnShowImage-&gt;Name = L"BtnShowImage";&lt;br /&gt;this-&gt;BtnShowImage-&gt;Size = System::Drawing::Size(321, 38);&lt;br /&gt;this-&gt;BtnShowImage-&gt;TabIndex = 0;&lt;br /&gt;this-&gt;BtnShowImage-&gt;Text = L"Show Image";&lt;br /&gt;this-&gt;BtnShowImage-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnShowImage-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnShowImage_Click);&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(345, 320);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnShowImage);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Show Image On Form&lt;br /&gt;private: System::Void BtnShowImage_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;Graphics^ShowImage_Graphics;&lt;br /&gt;Bitmap^ShowImage_Bitmap;&lt;br /&gt;ShowImage_Graphics=this-&gt;CreateGraphics();&lt;br /&gt;ShowImage_Bitmap=gcnew Bitmap("C:\\Flower.Bmp");&lt;br /&gt;ShowImage_Graphics-&gt;DrawImage(ShowImage_Bitmap,0,0,350,250);&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;BackColor=Color::AliceBlue;&lt;br /&gt;this-&gt;Text="Show Image On Form";&lt;br /&gt;this-&gt;MaximizeBox=false;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-5935956983902147976?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/5935956983902147976/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=5935956983902147976' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/5935956983902147976'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/5935956983902147976'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/show-image-on-form.html' title='Show Image On Form'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_MeJernKB7_c/SEvRVM82DnI/AAAAAAAAAOw/OogEBxjArGM/s72-c/Show+Image+On+Form.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-7002265180179340208</id><published>2008-06-08T05:20:00.000-07:00</published><updated>2008-06-08T05:26:14.360-07:00</updated><title type='text'>FillPie</title><content type='html'>&lt;a href="http://2.bp.blogspot.com/_MeJernKB7_c/SEvPw0-NZnI/AAAAAAAAAOo/usr3hraDNko/s1600-h/FillPie.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209485831744349810" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_MeJernKB7_c/SEvPw0-NZnI/AAAAAAAAAOo/usr3hraDNko/s320/FillPie.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My14 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(158, 142);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Paint += gcnew System::Windows::Forms::PaintEventHandler(this, &amp;amp;Form1::Form1_Paint);&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//FillPie&lt;br /&gt;private: System::Void Form1_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e) {&lt;br /&gt;Graphics^g;&lt;br /&gt;Brushes^HBrush;&lt;br /&gt;g=this-&gt;CreateGraphics();&lt;br /&gt;g-&gt;FillPie(HBrush-&gt;Coral,10,10,100,100,160,200);&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;Text="DrawPie";&lt;br /&gt;this-&gt;BackColor=System::Drawing::Color::Blue;&lt;br /&gt;this-&gt;MaximizeBox=false;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-7002265180179340208?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/7002265180179340208/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=7002265180179340208' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/7002265180179340208'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/7002265180179340208'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/fillpie.html' title='FillPie'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_MeJernKB7_c/SEvPw0-NZnI/AAAAAAAAAOo/usr3hraDNko/s72-c/FillPie.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-3978603554420136043</id><published>2008-06-08T05:15:00.000-07:00</published><updated>2008-06-08T05:18:35.311-07:00</updated><title type='text'>Move File</title><content type='html'>&lt;a href="http://2.bp.blogspot.com/_MeJernKB7_c/SEvN7szel_I/AAAAAAAAAOY/e73y_6w-DkQ/s1600-h/Move+File.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209483819507161074" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_MeJernKB7_c/SEvN7szel_I/AAAAAAAAAOY/e73y_6w-DkQ/s320/Move+File.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My13 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;using namespace System::IO;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::Button^ BtnCreateFile;&lt;br /&gt;protected:&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;BtnCreateFile = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// BtnCreateFile&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnCreateFile-&gt;Location = System::Drawing::Point(12, 12);&lt;br /&gt;this-&gt;BtnCreateFile-&gt;Name = L"BtnCreateFile";&lt;br /&gt;this-&gt;BtnCreateFile-&gt;Size = System::Drawing::Size(551, 61);&lt;br /&gt;this-&gt;BtnCreateFile-&gt;TabIndex = 0;&lt;br /&gt;this-&gt;BtnCreateFile-&gt;Text = L"Create File";&lt;br /&gt;this-&gt;BtnCreateFile-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnCreateFile-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnCreateFile_Click);&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(575, 90);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnCreateFile);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Move File&lt;br /&gt;private: System::Void BtnCreateFile_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;File::Move("D:\\01.Bmp","D:\\Download\\01.BMP");&lt;br /&gt;MessageBox::Show("Move File Completed","Move File");&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-3978603554420136043?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/3978603554420136043/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=3978603554420136043' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/3978603554420136043'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/3978603554420136043'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/move-file.html' title='Move File'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_MeJernKB7_c/SEvN7szel_I/AAAAAAAAAOY/e73y_6w-DkQ/s72-c/Move+File.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-6747147290821565980</id><published>2008-06-08T05:11:00.000-07:00</published><updated>2008-06-08T05:15:27.093-07:00</updated><title type='text'>Copy File</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_MeJernKB7_c/SEvNDYDIoiI/AAAAAAAAAOQ/QE7Zu-op1oc/s1600-h/Copy+File.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209482851863011874" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_MeJernKB7_c/SEvNDYDIoiI/AAAAAAAAAOQ/QE7Zu-op1oc/s320/Copy+File.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My12 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;using namespace System::IO;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::Button^ BtnCopyFile;&lt;br /&gt;private: System::Windows::Forms::Label^ lblSource;&lt;br /&gt;private: System::Windows::Forms::Label^ lblDes;&lt;br /&gt;protected:&lt;br /&gt;protected:&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;BtnCopyFile = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;lblSource = (gcnew System::Windows::Forms::Label());&lt;br /&gt;this-&gt;lblDes = (gcnew System::Windows::Forms::Label());&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// BtnCopyFile&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnCopyFile-&gt;Location = System::Drawing::Point(12, 118);&lt;br /&gt;this-&gt;BtnCopyFile-&gt;Name = L"BtnCopyFile";&lt;br /&gt;this-&gt;BtnCopyFile-&gt;Size = System::Drawing::Size(524, 33);&lt;br /&gt;this-&gt;BtnCopyFile-&gt;TabIndex = 0;&lt;br /&gt;this-&gt;BtnCopyFile-&gt;Text = L"Copy File";&lt;br /&gt;this-&gt;BtnCopyFile-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnCopyFile-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnCopyFile_Click);&lt;br /&gt;//&lt;br /&gt;// lblSource&lt;br /&gt;//&lt;br /&gt;this-&gt;lblSource-&gt;AutoSize = true;&lt;br /&gt;this-&gt;lblSource-&gt;Location = System::Drawing::Point(14, 21);&lt;br /&gt;this-&gt;lblSource-&gt;Name = L"lblSource";&lt;br /&gt;this-&gt;lblSource-&gt;Size = System::Drawing::Size(66, 13);&lt;br /&gt;this-&gt;lblSource-&gt;TabIndex = 1;&lt;br /&gt;this-&gt;lblSource-&gt;Text = L"Source File :";&lt;br /&gt;//&lt;br /&gt;// lblDes&lt;br /&gt;//&lt;br /&gt;this-&gt;lblDes-&gt;AutoSize = true;&lt;br /&gt;this-&gt;lblDes-&gt;Location = System::Drawing::Point(14, 75);&lt;br /&gt;this-&gt;lblDes-&gt;Name = L"lblDes";&lt;br /&gt;this-&gt;lblDes-&gt;Size = System::Drawing::Size(85, 13);&lt;br /&gt;this-&gt;lblDes-&gt;TabIndex = 2;&lt;br /&gt;this-&gt;lblDes-&gt;Text = L"Destination File :";&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(548, 163);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;lblDes);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;lblSource);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnCopyFile);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;this-&gt;PerformLayout();&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Copy File&lt;br /&gt;String^Source_File;&lt;br /&gt;String^Destination_File;&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;Source_File= "C:\\01.Bmp";&lt;br /&gt;Destination_File ="D:\\01.Bmp";&lt;br /&gt;lblSource-&gt;Text="Source File : "+Source_File;&lt;br /&gt;lblDes-&gt;Text="Destination File : "+Destination_File;&lt;br /&gt;}&lt;br /&gt;private: System::Void BtnCopyFile_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;File::Copy(Source_File,Destination_File);&lt;br /&gt;MessageBox::Show("Copy Completed","Copy File",System::Windows::Forms::MessageBoxButtons::OK,&lt;br /&gt;System::Windows::Forms::MessageBoxIcon::Information);&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-6747147290821565980?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/6747147290821565980/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=6747147290821565980' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/6747147290821565980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/6747147290821565980'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/copy-file.html' title='Copy File'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_MeJernKB7_c/SEvNDYDIoiI/AAAAAAAAAOQ/QE7Zu-op1oc/s72-c/Copy+File.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-5493805680750413578</id><published>2008-06-08T05:05:00.000-07:00</published><updated>2008-06-08T05:10:57.966-07:00</updated><title type='text'>Calculation Square</title><content type='html'>&lt;a href="http://1.bp.blogspot.com/_MeJernKB7_c/SEvLj10UdFI/AAAAAAAAAOI/U1wb6lwZ1dg/s1600-h/Calculation+Square.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209481210586494034" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_MeJernKB7_c/SEvLj10UdFI/AAAAAAAAAOI/U1wb6lwZ1dg/s320/Calculation+Square.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My11 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::Button^ BtnResult;&lt;br /&gt;private: System::Windows::Forms::TextBox^ txtSide2;&lt;br /&gt;protected:&lt;br /&gt;private: System::Windows::Forms::Label^ label1;&lt;br /&gt;private: System::Windows::Forms::PictureBox^ pctResult;&lt;br /&gt;private: System::Windows::Forms::Label^ label2;&lt;br /&gt;private: System::Windows::Forms::Label^ label3;&lt;br /&gt;private: System::Windows::Forms::TextBox^ txtSide1;&lt;br /&gt;&lt;br /&gt;protected:&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;BtnResult = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;txtSide2 = (gcnew System::Windows::Forms::TextBox());&lt;br /&gt;this-&gt;label1 = (gcnew System::Windows::Forms::Label());&lt;br /&gt;this-&gt;pctResult = (gcnew System::Windows::Forms::PictureBox());&lt;br /&gt;this-&gt;label2 = (gcnew System::Windows::Forms::Label());&lt;br /&gt;this-&gt;label3 = (gcnew System::Windows::Forms::Label());&lt;br /&gt;this-&gt;txtSide1 = (gcnew System::Windows::Forms::TextBox());&lt;br /&gt;(cli::safe_cast&lt;system::componentmodel::isupportinitialize^&gt;(this-&gt;pctResult))-&gt;BeginInit();&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// BtnResult&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnResult-&gt;Location = System::Drawing::Point(61, 166);&lt;br /&gt;this-&gt;BtnResult-&gt;Name = L"BtnResult";&lt;br /&gt;this-&gt;BtnResult-&gt;Size = System::Drawing::Size(238, 92);&lt;br /&gt;this-&gt;BtnResult-&gt;TabIndex = 0;&lt;br /&gt;this-&gt;BtnResult-&gt;Text = L"Show Result";&lt;br /&gt;this-&gt;BtnResult-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnResult-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnResult_Click);&lt;br /&gt;//&lt;br /&gt;// txtSide2&lt;br /&gt;//&lt;br /&gt;this-&gt;txtSide2-&gt;Location = System::Drawing::Point(61, 109);&lt;br /&gt;this-&gt;txtSide2-&gt;Name = L"txtSide2";&lt;br /&gt;this-&gt;txtSide2-&gt;Size = System::Drawing::Size(238, 20);&lt;br /&gt;this-&gt;txtSide2-&gt;TabIndex = 1;&lt;br /&gt;//&lt;br /&gt;// label1&lt;br /&gt;//&lt;br /&gt;this-&gt;label1-&gt;AutoSize = true;&lt;br /&gt;this-&gt;label1-&gt;Location = System::Drawing::Point(136, 26);&lt;br /&gt;this-&gt;label1-&gt;Name = L"label1";&lt;br /&gt;this-&gt;label1-&gt;Size = System::Drawing::Size(68, 13);&lt;br /&gt;this-&gt;label1-&gt;TabIndex = 2;&lt;br /&gt;this-&gt;label1-&gt;Text = L"Side X Side";&lt;br /&gt;//&lt;br /&gt;// pctResult&lt;br /&gt;//&lt;br /&gt;this-&gt;pctResult-&gt;BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;&lt;br /&gt;this-&gt;pctResult-&gt;Location = System::Drawing::Point(316, 12);&lt;br /&gt;this-&gt;pctResult-&gt;Name = L"pctResult";&lt;br /&gt;this-&gt;pctResult-&gt;Size = System::Drawing::Size(440, 242);&lt;br /&gt;this-&gt;pctResult-&gt;TabIndex = 3;&lt;br /&gt;this-&gt;pctResult-&gt;TabStop = false;&lt;br /&gt;//&lt;br /&gt;// label2&lt;br /&gt;//&lt;br /&gt;this-&gt;label2-&gt;AutoSize = true;&lt;br /&gt;this-&gt;label2-&gt;Location = System::Drawing::Point(12, 70);&lt;br /&gt;this-&gt;label2-&gt;Name = L"label2";&lt;br /&gt;this-&gt;label2-&gt;Size = System::Drawing::Size(40, 13);&lt;br /&gt;this-&gt;label2-&gt;TabIndex = 4;&lt;br /&gt;this-&gt;label2-&gt;Text = L"Side1 :";&lt;br /&gt;//&lt;br /&gt;// label3&lt;br /&gt;//&lt;br /&gt;this-&gt;label3-&gt;AutoSize = true;&lt;br /&gt;this-&gt;label3-&gt;Location = System::Drawing::Point(12, 112);&lt;br /&gt;this-&gt;label3-&gt;Name = L"label3";&lt;br /&gt;this-&gt;label3-&gt;Size = System::Drawing::Size(43, 13);&lt;br /&gt;this-&gt;label3-&gt;TabIndex = 5;&lt;br /&gt;this-&gt;label3-&gt;Text = L"Side2 :";&lt;br /&gt;//&lt;br /&gt;// txtSide1&lt;br /&gt;//&lt;br /&gt;this-&gt;txtSide1-&gt;Location = System::Drawing::Point(61, 67);&lt;br /&gt;this-&gt;txtSide1-&gt;Name = L"txtSide1";&lt;br /&gt;this-&gt;txtSide1-&gt;Size = System::Drawing::Size(238, 20);&lt;br /&gt;this-&gt;txtSide1-&gt;TabIndex = 6;&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(768, 273);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;txtSide1);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;label3);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;label2);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;pctResult);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;label1);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;txtSide2);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnResult);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;(cli::safe_cast&lt;system::componentmodel::isupportinitialize^&gt;(this-&gt;pctResult))-&gt;EndInit();&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;this-&gt;PerformLayout();&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Calculation Square&lt;br /&gt;double SquareSide1;&lt;br /&gt;double SquareSide2;&lt;br /&gt;Graphics^SquareGraphics;&lt;br /&gt;Pen^HPen;&lt;br /&gt;double ResultCalSquare()&lt;br /&gt;{&lt;br /&gt;double ReSquare;&lt;br /&gt;SquareSide1=System::Convert::ToDouble(txtSide1-&gt;Text);&lt;br /&gt;SquareSide2=System::Convert::ToDouble(txtSide2-&gt;Text);&lt;br /&gt;ReSquare=SquareSide1*SquareSide2;&lt;br /&gt;return ReSquare;&lt;br /&gt;}&lt;br /&gt;void DrawSquare()&lt;br /&gt;{&lt;br /&gt;HPen=gcnew Pen(Color::Blue,1);&lt;br /&gt;HPen-&gt;DashStyle=System::Drawing::Drawing2D::DashStyle::Dot;&lt;br /&gt;SquareGraphics-&gt;DrawRectangle(HPen,10,10,SquareSide1,SquareSide2);&lt;br /&gt;}&lt;br /&gt;private: System::Void BtnResult_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;ResultCalSquare();&lt;br /&gt;this-&gt;Text="Side1 : "+SquareSide1+" X "+"Side2 : "+&lt;br /&gt;SquareSide2+" = "+ResultCalSquare();&lt;br /&gt;SquareGraphics=pctResult-&gt;CreateGraphics();&lt;br /&gt;SquareGraphics-&gt;Clear(pctResult-&gt;BackColor);&lt;br /&gt;DrawSquare();&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;Text="Calculation Square";&lt;br /&gt;this-&gt;BackColor=System::Drawing::Color::Aqua;&lt;br /&gt;pctResult-&gt;BackColor=System::Drawing::Color::White;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;br /&gt;&lt;?XML:NAMESPACE PREFIX = System /&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-5493805680750413578?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/5493805680750413578/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=5493805680750413578' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/5493805680750413578'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/5493805680750413578'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/calculation-square.html' title='Calculation Square'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_MeJernKB7_c/SEvLj10UdFI/AAAAAAAAAOI/U1wb6lwZ1dg/s72-c/Calculation+Square.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-1961385813729854930</id><published>2008-06-08T05:01:00.000-07:00</published><updated>2008-06-08T05:05:32.912-07:00</updated><title type='text'>Calculation Rectangle</title><content type='html'>&lt;a href="http://1.bp.blogspot.com/_MeJernKB7_c/SEvKn-wwoZI/AAAAAAAAAOA/mCjg56ksadE/s1600-h/Calculation+Rectangle.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209480182195331474" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_MeJernKB7_c/SEvKn-wwoZI/AAAAAAAAAOA/mCjg56ksadE/s320/Calculation+Rectangle.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My10 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::TextBox^ txtRectangleWidth;&lt;br /&gt;private: System::Windows::Forms::Button^ BtnResult;&lt;br /&gt;protected:&lt;br /&gt;protected:&lt;br /&gt;private: System::Windows::Forms::TextBox^ txtRectangleLong;&lt;br /&gt;private: System::Windows::Forms::Label^ lbl;&lt;br /&gt;private: System::Windows::Forms::Label^ label1;&lt;br /&gt;private: System::Windows::Forms::Label^ label2;&lt;br /&gt;private: System::Windows::Forms::PictureBox^ pctResult;&lt;br /&gt;&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;txtRectangleWidth = (gcnew System::Windows::Forms::TextBox());&lt;br /&gt;this-&gt;BtnResult = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;txtRectangleLong = (gcnew System::Windows::Forms::TextBox());&lt;br /&gt;this-&gt;lbl = (gcnew System::Windows::Forms::Label());&lt;br /&gt;this-&gt;label1 = (gcnew System::Windows::Forms::Label());&lt;br /&gt;this-&gt;label2 = (gcnew System::Windows::Forms::Label());&lt;br /&gt;this-&gt;pctResult = (gcnew System::Windows::Forms::PictureBox());&lt;br /&gt;(cli::safe_cast&lt;/span&gt;&lt;?xml:namespace prefix = system /&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;span style="color:#ffffff;"&gt;(this-&gt;pctResult))-&gt;BeginInit();&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// txtRectangleWidth&lt;br /&gt;//&lt;br /&gt;this-&gt;txtRectangleWidth-&gt;Location = System::Drawing::Point(58, 59);&lt;br /&gt;this-&gt;txtRectangleWidth-&gt;Name = L"txtRectangleWidth";&lt;br /&gt;this-&gt;txtRectangleWidth-&gt;Size = System::Drawing::Size(202, 20);&lt;br /&gt;this-&gt;txtRectangleWidth-&gt;TabIndex = 0;&lt;br /&gt;//&lt;br /&gt;// BtnResult&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnResult-&gt;Location = System::Drawing::Point(58, 152);&lt;br /&gt;this-&gt;BtnResult-&gt;Name = L"BtnResult";&lt;br /&gt;this-&gt;BtnResult-&gt;Size = System::Drawing::Size(202, 86);&lt;br /&gt;this-&gt;BtnResult-&gt;TabIndex = 1;&lt;br /&gt;this-&gt;BtnResult-&gt;Text = L"Show Result";&lt;br /&gt;this-&gt;BtnResult-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnResult-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnResult_Click);&lt;br /&gt;//&lt;br /&gt;// txtRectangleLong&lt;br /&gt;//&lt;br /&gt;this-&gt;txtRectangleLong-&gt;Location = System::Drawing::Point(58, 106);&lt;br /&gt;this-&gt;txtRectangleLong-&gt;Name = L"txtRectangleLong";&lt;br /&gt;this-&gt;txtRectangleLong-&gt;Size = System::Drawing::Size(202, 20);&lt;br /&gt;this-&gt;txtRectangleLong-&gt;TabIndex = 2;&lt;br /&gt;//&lt;br /&gt;// lbl&lt;br /&gt;//&lt;br /&gt;this-&gt;lbl-&gt;AutoSize = true;&lt;br /&gt;this-&gt;lbl-&gt;Location = System::Drawing::Point(103, 20);&lt;br /&gt;this-&gt;lbl-&gt;Name = L"lbl";&lt;br /&gt;this-&gt;lbl-&gt;Size = System::Drawing::Size(90, 13);&lt;br /&gt;this-&gt;lbl-&gt;TabIndex = 3;&lt;br /&gt;this-&gt;lbl-&gt;Text = L": Width X Long";&lt;br /&gt;//&lt;br /&gt;// label1&lt;br /&gt;//&lt;br /&gt;this-&gt;label1-&gt;AutoSize = true;&lt;br /&gt;this-&gt;label1-&gt;Location = System::Drawing::Point(12, 59);&lt;br /&gt;this-&gt;label1-&gt;Name = L"label1";&lt;br /&gt;this-&gt;label1-&gt;Size = System::Drawing::Size(44, 13);&lt;br /&gt;this-&gt;label1-&gt;TabIndex = 4;&lt;br /&gt;this-&gt;label1-&gt;Text = L"Width : ";&lt;br /&gt;//&lt;br /&gt;// label2&lt;br /&gt;//&lt;br /&gt;this-&gt;label2-&gt;AutoSize = true;&lt;br /&gt;this-&gt;label2-&gt;Location = System::Drawing::Point(12, 109);&lt;br /&gt;this-&gt;label2-&gt;Name = L"label2";&lt;br /&gt;this-&gt;label2-&gt;Size = System::Drawing::Size(40, 13);&lt;br /&gt;this-&gt;label2-&gt;TabIndex = 5;&lt;br /&gt;this-&gt;label2-&gt;Text = L"Long : ";&lt;br /&gt;//&lt;br /&gt;// pctResult&lt;br /&gt;//&lt;br /&gt;this-&gt;pctResult-&gt;BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;&lt;br /&gt;this-&gt;pctResult-&gt;Location = System::Drawing::Point(273, 8);&lt;br /&gt;this-&gt;pctResult-&gt;Name = L"pctResult";&lt;br /&gt;this-&gt;pctResult-&gt;Size = System::Drawing::Size(420, 242);&lt;br /&gt;this-&gt;pctResult-&gt;TabIndex = 6;&lt;br /&gt;this-&gt;pctResult-&gt;TabStop = false;&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(705, 263);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;pctResult);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;label2);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;label1);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;lbl);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;txtRectangleLong);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnResult);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;txtRectangleWidth);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Calculation Rectangle";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;(cli::safe_cast&lt;/span&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;span style="color:#ffffff;"&gt;(this-&gt;pctResult))-&gt;EndInit();&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;this-&gt;PerformLayout();&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Calculation a Rectangle&lt;br /&gt;// Width X Long&lt;br /&gt;double RectangleWidth;&lt;br /&gt;double RectangleLong;&lt;br /&gt;double CalculationRectangle()&lt;br /&gt;{&lt;br /&gt;double RectangleResult;&lt;br /&gt;RectangleWidth=System::Convert::ToDouble(txtRectangleWidth-&gt;Text);&lt;br /&gt;RectangleLong=System::Convert::ToDouble(txtRectangleLong-&gt;Text);&lt;br /&gt;//Width X Long&lt;br /&gt;RectangleResult=RectangleWidth*RectangleLong;&lt;br /&gt;// Return Value&lt;br /&gt;return RectangleResult;&lt;br /&gt;}&lt;br /&gt;void DrawCalRectangle(Graphics^RectangleGraphics,int RectangleX,&lt;br /&gt;int RectangleY,int RectangleWidth,int RectangleHeight)&lt;br /&gt;{&lt;br /&gt;Pen^HPen;&lt;br /&gt;HPen=gcnew Pen(Color::Black,1);&lt;br /&gt;HPen-&gt;DashStyle=System::Drawing::Drawing2D::DashStyle::Dot;&lt;br /&gt;RectangleGraphics-&gt;DrawRectangle(HPen,RectangleX,&lt;br /&gt;RectangleY,RectangleWidth,RectangleHeight);&lt;br /&gt;}&lt;br /&gt;private: System::Void BtnResult_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;double ReCalRectangle;&lt;br /&gt;ReCalRectangle=CalculationRectangle();&lt;br /&gt;this-&gt;Text="Width = "+RectangleWidth+&lt;br /&gt;" Long = " +RectangleLong+ " = "+&lt;br /&gt;ReCalRectangle;&lt;br /&gt;Graphics^RecGraphics;&lt;br /&gt;RecGraphics=pctResult-&gt;CreateGraphics();&lt;br /&gt;RecGraphics-&gt;Clear(pctResult-&gt;BackColor);&lt;br /&gt;DrawCalRectangle(RecGraphics,10,&lt;br /&gt;10,RectangleWidth,RectangleLong);&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;pctResult-&gt;BackColor=System::Drawing::Color::White;&lt;br /&gt;this-&gt;BackColor=System::Drawing::Color::Yellow;&lt;br /&gt;this-&gt;Text="Calculation Rectangle";&lt;br /&gt;this-&gt;MaximizeBox=false;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-1961385813729854930?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/1961385813729854930/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=1961385813729854930' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/1961385813729854930'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/1961385813729854930'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/calculation-rectangle.html' title='Calculation Rectangle'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_MeJernKB7_c/SEvKn-wwoZI/AAAAAAAAAOA/mCjg56ksadE/s72-c/Calculation+Rectangle.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-7024367658140992779</id><published>2008-06-08T04:55:00.000-07:00</published><updated>2008-06-08T05:01:01.995-07:00</updated><title type='text'>Using Operator +</title><content type='html'>&lt;a href="http://2.bp.blogspot.com/_MeJernKB7_c/SEvJZKj0meI/AAAAAAAAAN4/v7O7_oJwfkQ/s1600-h/Using+Operator++.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209478828152625634" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_MeJernKB7_c/SEvJZKj0meI/AAAAAAAAAN4/v7O7_oJwfkQ/s320/Using+Operator+%2B.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My9 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::Label^ lblResult;&lt;br /&gt;protected:&lt;br /&gt;&lt;br /&gt;private: System::Windows::Forms::Button^ BtnResult;&lt;br /&gt;private: System::Windows::Forms::Label^ lblNum2;&lt;br /&gt;private: System::Windows::Forms::Label^ lblNum1;&lt;br /&gt;private: System::Windows::Forms::Label^ lblOper;&lt;br /&gt;private: System::Windows::Forms::Label^ label1;&lt;br /&gt;&lt;br /&gt;protected:&lt;br /&gt;protected:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;lblResult = (gcnew System::Windows::Forms::Label());&lt;br /&gt;this-&gt;BtnResult = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;lblNum2 = (gcnew System::Windows::Forms::Label());&lt;br /&gt;this-&gt;lblNum1 = (gcnew System::Windows::Forms::Label());&lt;br /&gt;this-&gt;lblOper = (gcnew System::Windows::Forms::Label());&lt;br /&gt;this-&gt;label1 = (gcnew System::Windows::Forms::Label());&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// lblResult&lt;br /&gt;//&lt;br /&gt;this-&gt;lblResult-&gt;AutoSize = true;&lt;br /&gt;this-&gt;lblResult-&gt;Font = (gcnew System::Drawing::Font(L"Times New Roman", 14.25F, static_cast&lt;/span&gt;&lt;system::drawing::fontstyle&gt;&lt;span style="color:#ffffff;"&gt;((System::Drawing::FontStyle::Bold System::Drawing::FontStyle::Underline)),&lt;br /&gt;System::Drawing::GraphicsUnit::Point, static_cast&lt;/span&gt;&lt;system::byte&gt;&lt;span style="color:#ffffff;"&gt;(0)));&lt;br /&gt;this-&gt;lblResult-&gt;ForeColor = System::Drawing::Color::FromArgb(static_cast&lt;/span&gt;&lt;system::int32&gt;&lt;span style="color:#ffffff;"&gt;(static_cast&lt;/span&gt;&lt;system::byte&gt;&lt;span style="color:#ffffff;"&gt;(0)), static_cast&lt;/span&gt;&lt;system::int32&gt;&lt;span style="color:#ffffff;"&gt;(static_cast&lt;/span&gt;&lt;system::byte&gt;&lt;span style="color:#ffffff;"&gt;(192)),&lt;br /&gt;static_cast&lt;/span&gt;&lt;system::int32&gt;&lt;span style="color:#ffffff;"&gt;(static_cast&lt;/span&gt;&lt;system::byte&gt;&lt;span style="color:#ffffff;"&gt;(0)));&lt;br /&gt;this-&gt;lblResult-&gt;Location = System::Drawing::Point(104, 128);&lt;br /&gt;this-&gt;lblResult-&gt;Name = L"lblResult";&lt;br /&gt;this-&gt;lblResult-&gt;Size = System::Drawing::Size(70, 22);&lt;br /&gt;this-&gt;lblResult-&gt;TabIndex = 2;&lt;br /&gt;this-&gt;lblResult-&gt;Text = L"............";&lt;br /&gt;//&lt;br /&gt;// BtnResult&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnResult-&gt;Location = System::Drawing::Point(28, 176);&lt;br /&gt;this-&gt;BtnResult-&gt;Name = L"BtnResult";&lt;br /&gt;this-&gt;BtnResult-&gt;Size = System::Drawing::Size(252, 32);&lt;br /&gt;this-&gt;BtnResult-&gt;TabIndex = 5;&lt;br /&gt;this-&gt;BtnResult-&gt;Text = L"Show Result";&lt;br /&gt;this-&gt;BtnResult-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnResult-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnResult_Click);&lt;br /&gt;//&lt;br /&gt;// lblNum2&lt;br /&gt;//&lt;br /&gt;this-&gt;lblNum2-&gt;AutoSize = true;&lt;br /&gt;this-&gt;lblNum2-&gt;Font = (gcnew System::Drawing::Font(L"Times New Roman", 14.25F, static_cast&lt;/span&gt;&lt;system::drawing::fontstyle&gt;&lt;span style="color:#ffffff;"&gt;((System::Drawing::FontStyle::Bold System::Drawing::FontStyle::Underline)),&lt;br /&gt;System::Drawing::GraphicsUnit::Point, static_cast&lt;/span&gt;&lt;system::byte&gt;&lt;span style="color:#ffffff;"&gt;(0)));&lt;br /&gt;this-&gt;lblNum2-&gt;ForeColor = System::Drawing::Color::Blue;&lt;br /&gt;this-&gt;lblNum2-&gt;Location = System::Drawing::Point(115, 68);&lt;br /&gt;this-&gt;lblNum2-&gt;Name = L"lblNum2";&lt;br /&gt;this-&gt;lblNum2-&gt;Size = System::Drawing::Size(59, 22);&lt;br /&gt;this-&gt;lblNum2-&gt;TabIndex = 6;&lt;br /&gt;this-&gt;lblNum2-&gt;Text = L"label3";&lt;br /&gt;//&lt;br /&gt;// lblNum1&lt;br /&gt;//&lt;br /&gt;this-&gt;lblNum1-&gt;AutoSize = true;&lt;br /&gt;this-&gt;lblNum1-&gt;Font = (gcnew System::Drawing::Font(L"Times New Roman", 14.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,&lt;br /&gt;static_cast&lt;/span&gt;&lt;system::byte&gt;&lt;span style="color:#ffffff;"&gt;(0)));&lt;br /&gt;this-&gt;lblNum1-&gt;ForeColor = System::Drawing::Color::Yellow;&lt;br /&gt;this-&gt;lblNum1-&gt;Location = System::Drawing::Point(115, 19);&lt;br /&gt;this-&gt;lblNum1-&gt;Name = L"lblNum1";&lt;br /&gt;this-&gt;lblNum1-&gt;Size = System::Drawing::Size(59, 22);&lt;br /&gt;this-&gt;lblNum1-&gt;TabIndex = 7;&lt;br /&gt;this-&gt;lblNum1-&gt;Text = L"label3";&lt;br /&gt;//&lt;br /&gt;// lblOper&lt;br /&gt;//&lt;br /&gt;this-&gt;lblOper-&gt;AutoSize = true;&lt;br /&gt;this-&gt;lblOper-&gt;Font = (gcnew System::Drawing::Font(L"Times New Roman", 14.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,&lt;br /&gt;static_cast&lt;/span&gt;&lt;system::byte&gt;&lt;span style="color:#ffffff;"&gt;(0)));&lt;br /&gt;this-&gt;lblOper-&gt;Location = System::Drawing::Point(180, 47);&lt;br /&gt;this-&gt;lblOper-&gt;Name = L"lblOper";&lt;br /&gt;this-&gt;lblOper-&gt;Size = System::Drawing::Size(21, 22);&lt;br /&gt;this-&gt;lblOper-&gt;TabIndex = 8;&lt;br /&gt;this-&gt;lblOper-&gt;Text = L"+";&lt;br /&gt;//&lt;br /&gt;// label1&lt;br /&gt;//&lt;br /&gt;this-&gt;label1-&gt;AutoSize = true;&lt;br /&gt;this-&gt;label1-&gt;Font = (gcnew System::Drawing::Font(L"Times New Roman", 14.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,&lt;br /&gt;static_cast&lt;/span&gt;&lt;system::byte&gt;&lt;span style="color:#ffffff;"&gt;(0)));&lt;br /&gt;this-&gt;label1-&gt;ForeColor = System::Drawing::Color::Black;&lt;br /&gt;this-&gt;label1-&gt;Location = System::Drawing::Point(133, 90);&lt;br /&gt;this-&gt;label1-&gt;Name = L"label1";&lt;br /&gt;this-&gt;label1-&gt;Size = System::Drawing::Size(21, 22);&lt;br /&gt;this-&gt;label1-&gt;TabIndex = 9;&lt;br /&gt;this-&gt;label1-&gt;Text = L"=";&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(292, 211);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;label1);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;lblOper);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;lblNum1);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;lblNum2);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnResult);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;lblResult);&lt;br /&gt;this-&gt;ForeColor = System::Drawing::Color::Black;&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;this-&gt;PerformLayout();&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;int cNum1;&lt;br /&gt;int cNum2;&lt;br /&gt;int cResult;&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;cNum1=935800;&lt;br /&gt;cNum2=108564;&lt;br /&gt;lblNum1-&gt;Text=cNum1.ToString();&lt;br /&gt;lblNum2-&gt;Text=cNum2.ToString();&lt;br /&gt;this-&gt;BackColor=Color::Pink;&lt;br /&gt;this-&gt;FormBorderStyle=Windows::Forms::FormBorderStyle::FixedToolWindow;&lt;br /&gt;}&lt;br /&gt;private: System::Void BtnResult_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;cResult=cNum1+cNum2;&lt;br /&gt;lblResult-&gt;Text=cResult.ToString();&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/system::byte&gt;&lt;/system::byte&gt;&lt;/system::byte&gt;&lt;/system::byte&gt;&lt;/system::drawing::fontstyle&gt;&lt;/system::byte&gt;&lt;/system::int32&gt;&lt;/system::byte&gt;&lt;/system::int32&gt;&lt;/system::byte&gt;&lt;/system::int32&gt;&lt;/system::byte&gt;&lt;/system::drawing::fontstyle&gt;&lt;br /&gt;&lt;?xml:namespace prefix = system /&gt;&lt;system::drawing::fontstyle&gt;&lt;system::byte&gt;&lt;system::int32&gt;&lt;system::byte&gt;&lt;system::int32&gt;&lt;system::byte&gt;&lt;system::int32&gt;&lt;system::byte&gt;&lt;system::drawing::fontstyle&gt;&lt;system::byte&gt;&lt;system::byte&gt;&lt;system::byte&gt;&lt;system::byte&gt;&lt;/system::byte&gt;&lt;/system::byte&gt;&lt;/system::byte&gt;&lt;/system::byte&gt;&lt;/system::drawing::fontstyle&gt;&lt;/system::byte&gt;&lt;/system::int32&gt;&lt;/system::byte&gt;&lt;/system::int32&gt;&lt;/system::byte&gt;&lt;/system::int32&gt;&lt;/system::byte&gt;&lt;/system::drawing::fontstyle&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-7024367658140992779?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/7024367658140992779/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=7024367658140992779' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/7024367658140992779'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/7024367658140992779'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/using-operator.html' title='Using Operator +'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_MeJernKB7_c/SEvJZKj0meI/AAAAAAAAAN4/v7O7_oJwfkQ/s72-c/Using+Operator+%2B.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-8162630483358665749</id><published>2008-06-08T04:50:00.000-07:00</published><updated>2008-06-08T04:55:04.693-07:00</updated><title type='text'>Array</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_MeJernKB7_c/SEvILBUNVVI/AAAAAAAAANw/j_gZa6uTIwM/s1600-h/Array.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209477485641422162" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_MeJernKB7_c/SEvILBUNVVI/AAAAAAAAANw/j_gZa6uTIwM/s320/Array.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My8 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::ListBox^ lstArray;&lt;br /&gt;protected:&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;lstArray = (gcnew System::Windows::Forms::ListBox());&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// lstArray&lt;br /&gt;//&lt;br /&gt;this-&gt;lstArray-&gt;FormattingEnabled = true;&lt;br /&gt;this-&gt;lstArray-&gt;Location = System::Drawing::Point(12, 21);&lt;br /&gt;this-&gt;lstArray-&gt;Name = L"lstArray";&lt;br /&gt;this-&gt;lstArray-&gt;Size = System::Drawing::Size(218, 225);&lt;br /&gt;this-&gt;lstArray-&gt;TabIndex = 0;&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(258, 258);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;lstArray);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Array&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;int a[]={5,10,15,20,25,30,35,40,45,50,&lt;br /&gt;55,60,65,70,75,80,85,90,95,100,105,110};&lt;br /&gt;int i;&lt;br /&gt;for(i=0;i&lt;=21;i++) { lstArray-&gt;Items-&gt;Add("Array : " +a[i].ToString());&lt;br /&gt;}&lt;br /&gt;this-&gt;BackColor=Color::Red;&lt;br /&gt;lstArray-&gt;BackColor=Color::Yellow;&lt;br /&gt;lstArray-&gt;ForeColor=Color::Blue;&lt;br /&gt;this-&gt;FormBorderStyle=Windows::Forms::FormBorderStyle::FixedToolWindow;&lt;br /&gt;this-&gt;Text="Using Array";&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-8162630483358665749?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/8162630483358665749/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=8162630483358665749' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/8162630483358665749'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/8162630483358665749'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/array.html' title='Array'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_MeJernKB7_c/SEvILBUNVVI/AAAAAAAAANw/j_gZa6uTIwM/s72-c/Array.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-8851044516075719392</id><published>2008-06-08T04:29:00.000-07:00</published><updated>2008-06-08T04:35:19.584-07:00</updated><title type='text'>DrawArc</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_MeJernKB7_c/SEvC3Ujc8uI/AAAAAAAAANo/v9a-oKFvYIU/s1600-h/DrawArc.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209471649650111202" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_MeJernKB7_c/SEvC3Ujc8uI/AAAAAAAAANo/v9a-oKFvYIU/s320/DrawArc.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My7 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::PictureBox^ pct;&lt;br /&gt;private: System::Windows::Forms::Button^ BtnDrawArc;&lt;br /&gt;protected:&lt;br /&gt;protected:&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;pct = (gcnew System::Windows::Forms::PictureBox());&lt;br /&gt;this-&gt;BtnDrawArc = (gcnew System::Windows::Forms::Button());&lt;br /&gt;(cli::safe_cast&lt;/span&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;span style="color:#ffffff;"&gt;(this-&gt;pct))-&gt;BeginInit();&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// pct&lt;br /&gt;//&lt;br /&gt;this-&gt;pct-&gt;Location = System::Drawing::Point(15, 18);&lt;br /&gt;this-&gt;pct-&gt;Name = L"pct";&lt;br /&gt;this-&gt;pct-&gt;Size = System::Drawing::Size(281, 264);&lt;br /&gt;this-&gt;pct-&gt;TabIndex = 0;&lt;br /&gt;this-&gt;pct-&gt;TabStop = false;&lt;br /&gt;//&lt;br /&gt;// BtnDrawArc&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnDrawArc-&gt;Location = System::Drawing::Point(127, 288);&lt;br /&gt;this-&gt;BtnDrawArc-&gt;Name = L"BtnDrawArc";&lt;br /&gt;this-&gt;BtnDrawArc-&gt;Size = System::Drawing::Size(74, 32);&lt;br /&gt;this-&gt;BtnDrawArc-&gt;TabIndex = 1;&lt;br /&gt;this-&gt;BtnDrawArc-&gt;Text = L"DrawArc";&lt;br /&gt;this-&gt;BtnDrawArc-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnDrawArc-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnDrawArc_Click);&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(312, 326);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnDrawArc);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;pct);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;(cli::safe_cast&lt;/span&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;span style="color:#ffffff;"&gt;(this-&gt;pct))-&gt;EndInit();&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//DrawArc&lt;br /&gt;private: System::Void BtnDrawArc_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;Graphics^TestGraphics;&lt;br /&gt;Pen^HPen;&lt;br /&gt;TestGraphics=pct-&gt;CreateGraphics();&lt;br /&gt;HPen=gcnew Pen(Color::Yellow,2);&lt;br /&gt;TestGraphics-&gt;DrawArc(HPen,10,10,200,200,50,160);&lt;br /&gt;TestGraphics-&gt;DrawArc(HPen,50,10,150,150,100,250);&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;pct-&gt;BorderStyle=Windows::Forms::BorderStyle::Fixed3D;&lt;br /&gt;pct-&gt;BackColor=Color::Black;&lt;br /&gt;this-&gt;BackColor=Color::Green;&lt;br /&gt;this-&gt;Text="DrawArc";&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;?XML:NAMESPACE PREFIX = System /&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;system::componentmodel::isupportinitialize^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;/system::componentmodel::isupportinitialize^&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-8851044516075719392?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/8851044516075719392/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=8851044516075719392' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/8851044516075719392'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/8851044516075719392'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/drawarc.html' title='DrawArc'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_MeJernKB7_c/SEvC3Ujc8uI/AAAAAAAAANo/v9a-oKFvYIU/s72-c/DrawArc.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-5793043948839687411</id><published>2008-06-08T04:21:00.000-07:00</published><updated>2008-06-08T04:29:01.791-07:00</updated><title type='text'>Using Progress Bar</title><content type='html'>&lt;a href="http://2.bp.blogspot.com/_MeJernKB7_c/SEvBUPL0MMI/AAAAAAAAANg/MwbDYu2u_ow/s1600-h/Using+Progress+Bar.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209469947401744578" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_MeJernKB7_c/SEvBUPL0MMI/AAAAAAAAANg/MwbDYu2u_ow/s320/Using+Progress+Bar.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My6 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private: System::Windows::Forms::ProgressBar^ pgb1;&lt;br /&gt;protected:&lt;br /&gt;private: System::Windows::Forms::Button^ BtnStart;&lt;br /&gt;private: System::Windows::Forms::Label^ lblPercent;&lt;br /&gt;private: System::Windows::Forms::ProgressBar^ pgb2;&lt;br /&gt;private: System::Windows::Forms::Timer^ t;&lt;br /&gt;private: System::ComponentModel::IContainer^ components;&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;components = (gcnew System::ComponentModel::Container());&lt;br /&gt;this-&gt;pgb1 = (gcnew System::Windows::Forms::ProgressBar());&lt;br /&gt;this-&gt;BtnStart = (gcnew System::Windows::Forms::Button());&lt;br /&gt;this-&gt;lblPercent = (gcnew System::Windows::Forms::Label());&lt;br /&gt;this-&gt;pgb2 = (gcnew System::Windows::Forms::ProgressBar());&lt;br /&gt;this-&gt;t = (gcnew System::Windows::Forms::Timer(this-&gt;components));&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// pgb1&lt;br /&gt;//&lt;br /&gt;this-&gt;pgb1-&gt;Location = System::Drawing::Point(12, 48);&lt;br /&gt;this-&gt;pgb1-&gt;Name = L"pgb1";&lt;br /&gt;this-&gt;pgb1-&gt;Size = System::Drawing::Size(502, 28);&lt;br /&gt;this-&gt;pgb1-&gt;TabIndex = 0;&lt;br /&gt;//&lt;br /&gt;// BtnStart&lt;br /&gt;//&lt;br /&gt;this-&gt;BtnStart-&gt;Location = System::Drawing::Point(205, 127);&lt;br /&gt;this-&gt;BtnStart-&gt;Name = L"BtnStart";&lt;br /&gt;this-&gt;BtnStart-&gt;Size = System::Drawing::Size(127, 40);&lt;br /&gt;this-&gt;BtnStart-&gt;TabIndex = 1;&lt;br /&gt;this-&gt;BtnStart-&gt;Text = L"Start";&lt;br /&gt;this-&gt;BtnStart-&gt;UseVisualStyleBackColor = true;&lt;br /&gt;this-&gt;BtnStart-&gt;Click += gcnew System::EventHandler(this, &amp;amp;Form1::BtnStart_Click);&lt;br /&gt;//&lt;br /&gt;// lblPercent&lt;br /&gt;//&lt;br /&gt;this-&gt;lblPercent-&gt;AutoSize = true;&lt;br /&gt;this-&gt;lblPercent-&gt;Location = System::Drawing::Point(235, 22);&lt;br /&gt;this-&gt;lblPercent-&gt;Name = L"lblPercent";&lt;br /&gt;this-&gt;lblPercent-&gt;Size = System::Drawing::Size(21, 13);&lt;br /&gt;this-&gt;lblPercent-&gt;TabIndex = 2;&lt;br /&gt;this-&gt;lblPercent-&gt;Text = L"0%";&lt;br /&gt;//&lt;br /&gt;// pgb2&lt;br /&gt;//&lt;br /&gt;this-&gt;pgb2-&gt;Location = System::Drawing::Point(12, 82);&lt;br /&gt;this-&gt;pgb2-&gt;Name = L"pgb2";&lt;br /&gt;this-&gt;pgb2-&gt;Size = System::Drawing::Size(502, 28);&lt;br /&gt;this-&gt;pgb2-&gt;TabIndex = 3;&lt;br /&gt;//&lt;br /&gt;// t&lt;br /&gt;//&lt;br /&gt;this-&gt;t-&gt;Interval = 1;&lt;br /&gt;this-&gt;t-&gt;Tick += gcnew System::EventHandler(this, &amp;amp;Form1::t_Tick);&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(538, 170);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;pgb2);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;lblPercent);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;BtnStart);&lt;br /&gt;this-&gt;Controls-&gt;Add(this-&gt;pgb1);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;this-&gt;PerformLayout();&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Using Progress Bar&lt;br /&gt;private: System::Void BtnStart_Click(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;pgb1-&gt;Value=0;&lt;br /&gt;pgb2-&gt;Value=0;&lt;br /&gt;t-&gt;Enabled=true;&lt;br /&gt;BtnStart-&gt;Enabled=false;&lt;br /&gt;}&lt;br /&gt;private: System::Void t_Tick(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;pgb1-&gt;Value=pgb1-&gt;Value+1;&lt;br /&gt;if(pgb1-&gt;Value==pgb1-&gt;Maximum)&lt;br /&gt;{&lt;br /&gt;pgb1-&gt;Value=pgb1-&gt;Minimum;&lt;br /&gt;pgb2-&gt;Value=pgb2-&gt;Value+1;&lt;br /&gt;lblPercent-&gt;Text=pgb2-&gt;Value.ToString()+"%";&lt;br /&gt;if(pgb2-&gt;Value==pgb2-&gt;Maximum)&lt;br /&gt;{&lt;br /&gt;t-&gt;Enabled=false;&lt;br /&gt;BtnStart-&gt;Enabled=true;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-5793043948839687411?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/5793043948839687411/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=5793043948839687411' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/5793043948839687411'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/5793043948839687411'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/using-progress-bar.html' title='Using Progress Bar'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_MeJernKB7_c/SEvBUPL0MMI/AAAAAAAAANg/MwbDYu2u_ow/s72-c/Using+Progress+Bar.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-235419030524298684</id><published>2008-06-08T04:17:00.000-07:00</published><updated>2008-06-08T04:21:31.632-07:00</updated><title type='text'>Create Function</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_MeJernKB7_c/SEvAXW88rtI/AAAAAAAAANY/CsnMvH_RUlk/s1600-h/Create+Function+2.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209468901514850002" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_MeJernKB7_c/SEvAXW88rtI/AAAAAAAAANY/CsnMvH_RUlk/s320/Create+Function+2.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My5 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(292, 266);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Create Function&lt;br /&gt;int Max(String^Str)&lt;br /&gt;{&lt;br /&gt;int Len;&lt;br /&gt;Len=Str-&gt;Length;&lt;br /&gt;return Len;&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;Text=Max("String").ToString();&lt;br /&gt;this-&gt;Width=200;&lt;br /&gt;this-&gt;Height=50;&lt;br /&gt;this-&gt;FormBorderStyle=Windows::Forms::FormBorderStyle::FixedToolWindow;&lt;br /&gt;this-&gt;BackColor=Color::Violet;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-235419030524298684?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/235419030524298684/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=235419030524298684' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/235419030524298684'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/235419030524298684'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/create-function.html' title='Create Function'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_MeJernKB7_c/SEvAXW88rtI/AAAAAAAAANY/CsnMvH_RUlk/s72-c/Create+Function+2.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-1496775915350846186</id><published>2008-06-08T04:14:00.000-07:00</published><updated>2008-06-08T04:17:13.494-07:00</updated><title type='text'>Create Function 1</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_MeJernKB7_c/SEu_jZa5tXI/AAAAAAAAANQ/-_q-xPjsOOI/s1600-h/Create+Function+1.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209468008824157554" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_MeJernKB7_c/SEu_jZa5tXI/AAAAAAAAANQ/-_q-xPjsOOI/s320/Create+Function+1.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My4 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(292, 266);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Create Function 1&lt;br /&gt;float Max(int NumValue)&lt;br /&gt;{&lt;br /&gt;float ReValue;&lt;br /&gt;ReValue=NumValue/(75*36);&lt;br /&gt;return ReValue;&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;float Sum;&lt;br /&gt;Sum=Max(66758490);&lt;br /&gt;this-&gt;Text=Sum.ToString();&lt;br /&gt;this-&gt;BackColor=Color::PaleGreen;&lt;br /&gt;this-&gt;FormBorderStyle=Windows::Forms::FormBorderStyle::FixedToolWindow;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-1496775915350846186?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/1496775915350846186/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=1496775915350846186' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/1496775915350846186'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/1496775915350846186'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/create-function-1.html' title='Create Function 1'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_MeJernKB7_c/SEu_jZa5tXI/AAAAAAAAANQ/-_q-xPjsOOI/s72-c/Create+Function+1.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-8584670800734259870</id><published>2008-06-08T04:07:00.000-07:00</published><updated>2008-06-08T04:13:05.510-07:00</updated><title type='text'>Using MessageBox</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_MeJernKB7_c/SEu-jIJGB3I/AAAAAAAAANI/qKgplHiMQKk/s1600-h/Using+MessageBox.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209466904674436978" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_MeJernKB7_c/SEu-jIJGB3I/AAAAAAAAANI/qKgplHiMQKk/s320/Using+MessageBox.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My3 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(292, 266);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//Using MessageBox&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;MessageBox::Show("Using MessageBox","MessageBox",MessageBoxButtons::OK,&lt;br /&gt;MessageBoxIcon::Information);&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-8584670800734259870?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/8584670800734259870/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=8584670800734259870' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/8584670800734259870'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/8584670800734259870'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/using-messagebox.html' title='Using MessageBox'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_MeJernKB7_c/SEu-jIJGB3I/AAAAAAAAANI/qKgplHiMQKk/s72-c/Using+MessageBox.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-6511501243588799486</id><published>2008-06-08T03:56:00.000-07:00</published><updated>2008-06-08T04:07:19.321-07:00</updated><title type='text'>MouseMove GetCurrent X , GetCurrent Y</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_MeJernKB7_c/SEu87fd42rI/AAAAAAAAANA/SDjUgXQjePE/s1600-h/MouseMove.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209465124229274290" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_MeJernKB7_c/SEu87fd42rI/AAAAAAAAANA/SDjUgXQjePE/s320/MouseMove.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My2 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(292, 266);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;MouseMove += gcnew System::Windows::Forms::MouseEventHandler(this, &amp;amp;Form1::Form1_MouseMove);&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//MouseMove GetCurrent X , GetCurrent Y&lt;br /&gt;private: System::Void Form1_MouseMove(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) {&lt;br /&gt;this-&gt;Text="Mouse X : " + e-&gt;X.ToString()+&lt;br /&gt;" Mouse Y : " + e-&gt;Y.ToString();&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;Text="MouseMove GetCurrent X , GetCurrent Y";&lt;br /&gt;this-&gt;FormBorderStyle=Windows::Forms::FormBorderStyle::FixedToolWindow;&lt;br /&gt;this-&gt;Width=300;&lt;br /&gt;this-&gt;Height=300;&lt;br /&gt;this-&gt;BackColor=Color::Red;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-6511501243588799486?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/6511501243588799486/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=6511501243588799486' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/6511501243588799486'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/6511501243588799486'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/mousemove-getcurrent-x-getcurrent-y.html' title='MouseMove GetCurrent X , GetCurrent Y'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_MeJernKB7_c/SEu87fd42rI/AAAAAAAAANA/SDjUgXQjePE/s72-c/MouseMove.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-2621041503258794389</id><published>2008-06-08T03:54:00.000-07:00</published><updated>2008-06-08T04:04:32.845-07:00</updated><title type='text'>DrawLine</title><content type='html'>&lt;a href="http://2.bp.blogspot.com/_MeJernKB7_c/SEu8lxNdMRI/AAAAAAAAAM4/XMBrOlsxTvY/s1600-h/DrawLine.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5209464751035068690" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_MeJernKB7_c/SEu8lxNdMRI/AAAAAAAAAM4/XMBrOlsxTvY/s320/DrawLine.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color:#ffffff;"&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span style="color:#ffffff;"&gt;#pragma once&lt;br /&gt;&lt;br /&gt;namespace My1 {&lt;br /&gt;using namespace System;&lt;br /&gt;using namespace System::ComponentModel;&lt;br /&gt;using namespace System::Collections;&lt;br /&gt;using namespace System::Windows::Forms;&lt;br /&gt;using namespace System::Data;&lt;br /&gt;using namespace System::Drawing;&lt;br /&gt;using namespace System::Drawing::Drawing2D;&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Summary for Form1&lt;br /&gt;///&lt;br /&gt;/// WARNING: If you change the name of this class, you will need to change the&lt;br /&gt;/// 'Resource File Name' property for the managed resource compiler tool&lt;br /&gt;/// associated with all .resx files this class depends on. Otherwise,&lt;br /&gt;/// the designers will not be able to interact properly with localized&lt;br /&gt;/// resources associated with this form.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;public ref class Form1 : public System::Windows::Forms::Form&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Form1(void)&lt;br /&gt;{&lt;br /&gt;InitializeComponent();&lt;br /&gt;//&lt;br /&gt;//TODO: Add the constructor code here&lt;br /&gt;//&lt;br /&gt;}&lt;br /&gt;protected:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Clean up any resources being used.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;~Form1()&lt;br /&gt;{&lt;br /&gt;if (components)&lt;br /&gt;{&lt;br /&gt;delete components;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;private:&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required designer variable.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;System::ComponentModel::Container ^components;&lt;br /&gt;#pragma region Windows Form Designer generated code&lt;br /&gt;/// &lt;summary&gt;&lt;br /&gt;/// Required method for Designer support - do not modify&lt;br /&gt;/// the contents of this method with the code editor.&lt;br /&gt;/// &lt;/summary&gt;&lt;br /&gt;void InitializeComponent(void)&lt;br /&gt;{&lt;br /&gt;this-&gt;SuspendLayout();&lt;br /&gt;//&lt;br /&gt;// Form1&lt;br /&gt;//&lt;br /&gt;this-&gt;AutoScaleDimensions = System::Drawing::SizeF(6, 13);&lt;br /&gt;this-&gt;AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;&lt;br /&gt;this-&gt;ClientSize = System::Drawing::Size(292, 266);&lt;br /&gt;this-&gt;Name = L"Form1";&lt;br /&gt;this-&gt;Text = L"Form1";&lt;br /&gt;this-&gt;Paint += gcnew System::Windows::Forms::PaintEventHandler(this, &amp;amp;Form1::Form1_Paint);&lt;br /&gt;this-&gt;Load += gcnew System::EventHandler(this, &amp;amp;Form1::Form1_Load);&lt;br /&gt;this-&gt;ResumeLayout(false);&lt;br /&gt;}&lt;br /&gt;#pragma endregion&lt;br /&gt;//DrawLine&lt;br /&gt;private: System::Void Form1_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e) {&lt;br /&gt;Graphics^TestGraphics;&lt;br /&gt;Pen^HPen;&lt;br /&gt;TestGraphics=this-&gt;CreateGraphics();&lt;br /&gt;HPen=gcnew Pen(Color::White,2);&lt;br /&gt;TestGraphics-&gt;DrawLine(HPen,0,0,this-&gt;Width+20,this-&gt;Height);&lt;br /&gt;}&lt;br /&gt;private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {&lt;br /&gt;this-&gt;Text="DrawLine";&lt;br /&gt;this-&gt;Width=500;&lt;br /&gt;this-&gt;Height=500;&lt;br /&gt;this-&gt;FormBorderStyle=Windows::Forms::FormBorderStyle::FixedToolWindow;&lt;br /&gt;this-&gt;BackColor=Color::Black;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-2621041503258794389?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/2621041503258794389/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=2621041503258794389' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/2621041503258794389'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/2621041503258794389'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/drawline.html' title='DrawLine'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_MeJernKB7_c/SEu8lxNdMRI/AAAAAAAAAM4/XMBrOlsxTvY/s72-c/DrawLine.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-8179740619373992853</id><published>2008-06-07T19:45:00.000-07:00</published><updated>2008-06-07T20:21:25.925-07:00</updated><title type='text'>The Edit Buffer</title><content type='html'>&lt;span style="color:#ffff00;"&gt;Taken collectively, the field data members of a recordset serve as an edit buffer that contains one record — the current record. Update operations use this buffer to operate on the current record.&lt;br /&gt;When you add a record, the edit buffer is used to build a new record. When you finish adding the record, the record that was previously current becomes current again.&lt;br /&gt;When you update (edit) a record, the edit buffer is used to set the field data members of the recordset to new values. When you finish updating, the updated record is still current.&lt;br /&gt;When you call AddNew or Edit, the current record is stored so it can be restored later as needed. When you call Delete, the current record is not stored but is marked as deleted and you must scroll to another record.&lt;br /&gt;Note The edit buffer plays no role in record deletion. When you delete the current record, the record is marked as deleted, and the recordset is "not on a record" until you scroll to a different record.&lt;br /&gt;Dynasets and SnapshotsDynasets refresh a record's contents as you scroll to the record. Snapshots are static representations of the records, so a record's contents are not refreshed unless you call Requery. To use all the functionality of dynasets, you must be working with an ODBC driver that conforms to the correct level of ODBC API support. For more information, see ODBC and Dynaset.&lt;br /&gt;Snapshot&lt;br /&gt;A snapshot is a recordset that reflects a static view of the data as it existed at the time the snapshot was created. When you open the snapshot and move to all the records, the set of records it contains and their values do not change until you rebuild the snapshot by calling Requery.&lt;br /&gt;Note This topic applies to the MFC ODBC classes. If you are using the MFC DAO classes instead of the MFC ODBC classes, see CDaoRecordset::Open for a description of snapshot-type recordsets.&lt;br /&gt;You can create updateable or read-only snapshots with the database classes. Unlike a dynaset, an updateable snapshot does not reflect changes to record values made by other users, but it does reflect updates and deletions made by your program. Records added to a snapshot do not become visible to the snapshot until you call Requery.&lt;br /&gt;Tip A snapshot is an ODBC static cursor. Static cursors do not actually get a row of data until you scroll to that record. To ensure that all records are immediately retrieved, you can scroll to the end of your recordset and then scroll to the first record you want to see. Note, however, that scrolling to the end entails extra overhead and can lower performance.&lt;br /&gt;Snapshots are most valuable when you need the data to remain fixed during your operations, as when you are generating a report or performing calculations. Even so, the data source can diverge considerably from your snapshot, so you might want to rebuild it from time to time.&lt;br /&gt;Snapshot support is based on the ODBC Cursor Library, which provides static cursors and positioned updates (needed for updateability) for any Level 1 driver. The cursor library DLL must be loaded in memory for this support. When you construct a CDatabase object and call its OpenEx member function, you must specify the CDatabase::useCursorLib option of the dwOptions parameter. If you call the Open member function, the cursor library is loaded by default. If you are using dynasets instead of snapshots, you do not want to cause the cursor library to be loaded.&lt;br /&gt;Snapshots are available only if the ODBC Cursor Library was loaded when the CDatabase object was constructed or the ODBC driver you are using supports static cursors.&lt;br /&gt;Note For some ODBC drivers, snapshots (static cursors) might not be updateable. Check your driver documentation for cursor types supported and the concurrency types they support. To guarantee updateable snapshots, make sure you load the cursor library into memory when you create a CDatabase object. For more information, see ODBC: The ODBC Cursor Library. Note If you want to use both snapshots and dynasets, you must base them on two different CDatabase objects (two different connections).&lt;br /&gt;For more information about the properties snapshots share with all recordsets, see Recordset (ODBC). For more information about ODBC and snapshots, including the ODBC Cursor Library, see ODBC.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-8179740619373992853?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/8179740619373992853/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=8179740619373992853' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/8179740619373992853'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/8179740619373992853'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/edit-buffer.html' title='The Edit Buffer'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-7632995491779978084</id><published>2008-06-07T19:44:00.001-07:00</published><updated>2008-06-07T20:24:52.512-07:00</updated><title type='text'>Transaction: How Transactions Affect Updates (ODBC)</title><content type='html'>&lt;span style="color:#ffff00;"&gt;Updates to the data source are managed during transactions through the use of an edit buffer (the same method used outside of transactions). The field data members of a recordset collectively serve as an edit buffer that contains the current record, which the recordset backs up temporarily during an AddNew or Edit. During a Delete operation, the current record is not backed up within a transaction. For more information about the edit buffer and how updates store the current record, see Recordset: How Recordsets Update Records (ODBC).&lt;br /&gt;Note If you have implemented bulk row fetching, you cannot call AddNew, Edit, or Delete. You must instead write your own functions to perform updates to the data source. For more information about bulk row fetching, see Recordset: Fetching Records in Bulk (ODBC).&lt;br /&gt;During transactions, AddNew, Edit, and Delete operations can be committed or rolled back. The effects of CommitTrans and Rollback might cause the current record to not be restored to the edit buffer. To make sure that the current record is properly restored, it is important to understand how the CommitTrans and Rollback member functions of CDatabase work with the update functions of CRecordset.&lt;br /&gt;The Edit Buffer&lt;br /&gt;Recordset: How Recordsets Update Records (ODBC)&lt;br /&gt;This topic applies to the MFC ODBC classes.&lt;br /&gt;Besides their ability to select records from a data source, recordsets can (optionally) update or delete the selected records or add new records. Three factors determine a recordset's updateability: whether the connected data source is updateable, the options you specify when you create a recordset object, and the SQL that is created.&lt;br /&gt;Note The SQL on which your CRecordset object is based can affect your recordset's updateability. For example, if your SQL contains a join or a GROUP BY clause, MFC sets the updateability to FALSE.Note This topic applies to objects derived from CRecordset in which bulk row fetching has not been implemented. If you are using bulk row fetching, see Recordset: Fetching Records in Bulk (ODBC).&lt;br /&gt;This topic explains:&lt;br /&gt;Your role in recordset updating and what the framework does for you.&lt;br /&gt;The recordset as an edit buffer and the differences between dynasets and snapshots.&lt;br /&gt;Recordset: How AddNew, Edit, and Delete Work (ODBC) describes the actions of these functions from the point of view of the recordset.&lt;br /&gt;Recordset: More About Updates (ODBC) completes the recordset update story by explaining how transactions affect updates, how closing a recordset or scrolling affects updates in progress, and how your updates interact with the updates of other users.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-7632995491779978084?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/7632995491779978084/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=7632995491779978084' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/7632995491779978084'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/7632995491779978084'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/transaction-how-transactions-affect.html' title='Transaction: How Transactions Affect Updates (ODBC)'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-5529326430591795142</id><published>2008-06-07T19:42:00.001-07:00</published><updated>2008-06-07T20:27:38.391-07:00</updated><title type='text'>Transaction: Performing a Transaction in a Recordset (ODBC)</title><content type='html'>&lt;span style="color:#ffff00;"&gt;This topic explains how to perform a transaction in a recordset.&lt;br /&gt;Note Only one level of transactions is supported; you cannot nest transactions.To perform a transaction in a recordsetCall the CDatabase object's BeginTrans member function.&lt;br /&gt;If you have not implemented bulk row fetching, call the AddNew/Update, Edit/Update, and Delete member functions of one or more recordset objects of the same database as many times as needed. For more information, see Recordset: Adding, Updating, and Deleting Records (ODBC). If you have implemented bulk row fetching, you must write your own functions to update the data source.&lt;br /&gt;Finally, call the CDatabase object's CommitTrans member function. If an error occurs in one of the updates or you decide to cancel the changes, call its Rollback member function.&lt;br /&gt;The following example uses two recordsets to delete a student's enrollment from a school registration database, removing the student from all classes in which the student is enrolled. Because the Delete calls in both recordsets must succeed, a transaction is required. The example assumes the existence of m_dbStudentReg, a member variable of type CDatabase already connected to the data source, and the recordset classes CEnrollmentSet and CStudentSet. The strStudentID variable contains a value obtained from the user.BOOL CEnrollDoc::RemoveStudent( CString strStudentID ){// remove student from all the classes// the student is enrolled in&lt;br /&gt;if ( !m_dbStudentReg.BeginTrans( ) )return FALSE;&lt;br /&gt;CEnrollmentSet rsEnrollmentSet(&amp;amp;m_dbStudentReg);rsEnrollmentSet.m_strFilter = "StudentID = " + strStudentID;&lt;br /&gt;if ( !rsEnrollmentSet.Open(CRecordset::dynaset) )return FALSE;&lt;br /&gt;CStudentSet rsStudentSet(&amp;amp;m_dbStudentReg);rsStudentSet.m_strFilter = "StudentID = " + strStudentID;&lt;br /&gt;if ( !rsStudentSet.Open(CRecordset::dynaset) )return FALSE;&lt;br /&gt;TRY{while ( !rsEnrollmentSet.IsEOF( ) ){rsEnrollmentSet.Delete( );rsEnrollmentSet.MoveNext( );}&lt;br /&gt;// delete the student recordrsStudentSet.Delete( );&lt;br /&gt;m_dbStudentReg.CommitTrans( );}&lt;br /&gt;CATCH_ALL(e){m_dbStudentReg.Rollback( );return FALSE;}END_CATCH_ALL&lt;br /&gt;rsEnrollmentSet.Close( );rsStudentSet.Close( );&lt;br /&gt;return TRUE;&lt;br /&gt;}Note Calling BeginTrans again without calling CommitTrans or Rollback is an error.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-5529326430591795142?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/5529326430591795142/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=5529326430591795142' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/5529326430591795142'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/5529326430591795142'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/transaction-performing-transaction-in.html' title='Transaction: Performing a Transaction in a Recordset (ODBC)'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-8130574904837543606</id><published>2008-06-07T18:30:00.000-07:00</published><updated>2008-06-07T20:38:55.345-07:00</updated><title type='text'>How to: Marshal a SAFEARRAY for ADO.NET</title><content type='html'>&lt;span style="color:#ffff00;"&gt;Demonstrates how to add a native SAFEARRAY to a database and how to marshal a managed array from a database to a native SAFEARRAY.&lt;br /&gt;ExampleIn this example, the class DatabaseClass is created to interact with an ADO.NET DataTable object. Note that this class is a native C++ class (as compared to a ref class or value class). This is necessary because we want to use this class from native code, and you cannot use managed types in native code. This class will be compiled to target the CLR, as is indicated by the #pragma managed directive preceding the class declaration. For more information on this directive, see managed, unmanaged.&lt;br /&gt;Note the private member of the DatabaseClass class: gcroot&lt;datatable&gt; table. Since native types cannot contain managed types, the gcroot keyword is necessary. For more information on gcroot, see How to: Declare Handles in Native Types.&lt;br /&gt;The rest of the code in this example is native C++ code, as is indicated by the #pragma unmanaged directive preceding main. In this example, we are creating a new instance of DatabaseClass and calling its methods to create a table and populate some rows in the table. Note that native SAFEARRAY types are being passed as values for the database column ArrayIntsCol. Inside DatabaseClass, these SAFEARRAY types are marshaled to managed objects using the marshaling functionality found in the System.Runtime.InteropServices namespace. Specifically, the method Copy is used to marshal a SAFEARRAY to a managed array of integers, and the method Copy is used to marshal a managed array of integers to a SAFEARRAY.&lt;br /&gt;// adonet_marshal_safearray.cpp// compile with: /clr /FU System.dll /FU System.Data.dll /FU System.Xml.dll#include &lt;comdef.h&gt;#include &lt;gcroot.h&gt;#include &lt;iostream&gt;using namespace std;&lt;br /&gt;#using &lt;system.data.dll&gt;using namespace System;using namespace System::Data;using namespace System::Runtime::InteropServices;&lt;br /&gt;#define MAXCOLS 100&lt;br /&gt;#pragma managedclass DatabaseClass{public:DatabaseClass() : table(nullptr) { }&lt;br /&gt;void AddRow(SAFEARRAY *arrayIntsColValue){// Add a row to the table.DataRow ^row = table-&gt;NewRow();int len = arrayIntsColValue-&gt;rgsabound[0].cElements;array&lt;int&gt; ^arr = gcnew array&lt;int&gt;(len);&lt;br /&gt;int *pData;SafeArrayAccessData(arrayIntsColValue, (void **)&amp;amp;pData);Marshal::Copy(IntPtr(pData), arr, 0, len);SafeArrayUnaccessData(arrayIntsColValue);&lt;br /&gt;row["ArrayIntsCol"] = arr;table-&gt;Rows-&gt;Add(row);}&lt;br /&gt;void CreateAndPopulateTable(){// Create a simple DataTable.table = gcnew DataTable("SampleTable");&lt;br /&gt;// Add a column of type String to the table.DataColumn ^column1 = gcnew DataColumn("ArrayIntsCol",Type::GetType("System.Int32[]"));table-&gt;Columns-&gt;Add(column1);}&lt;br /&gt;int GetValuesForColumn(wchar_t *dataColumn, SAFEARRAY **values,int valuesLength){// Marshal the name of the column to a managed// String.String ^columnStr = Marshal::PtrToStringUni((IntPtr)dataColumn);&lt;br /&gt;// Get all rows in the table.array&lt;datarow&gt; ^rows = table-&gt;Select();int len = rows-&gt;Length;len = (len &gt; valuesLength) ? valuesLength : len;for (int i = 0; i &lt;&gt; ^)rows[i][columnStr], 0,IntPtr(pData), 10);SafeArrayUnaccessData(values[i]);}&lt;br /&gt;return len;}&lt;br /&gt;private:// Using gcroot, you can use a managed type in// a native class.gcroot&lt;datatable&gt; table;};&lt;br /&gt;#pragma unmanagedint main(){// Create a table and add a few rows to it.DatabaseClass *db = new DatabaseClass();db-&gt;CreateAndPopulateTable();&lt;br /&gt;// Create a standard array.int originalArray[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };&lt;br /&gt;// Create a SAFEARRAY.SAFEARRAY *psa;psa = SafeArrayCreateVector(VT_I4, 0, 10);&lt;br /&gt;// Copy the data from the original array to the SAFEARRAY.int *pData;HRESULT hr = SafeArrayAccessData(psa, (void **)&amp;amp;pData);memcpy(pData, &amp;amp;originalArray, 40);SafeArrayUnaccessData(psa);db-&gt;AddRow(psa);&lt;br /&gt;// Now retrieve the rows and display their contents.SAFEARRAY *values[MAXCOLS];int len = db-&gt;GetValuesForColumn(L"ArrayIntsCol", values, MAXCOLS);for (int i = 0; i &lt; j =" 0;"&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-8130574904837543606?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/8130574904837543606/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=8130574904837543606' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/8130574904837543606'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/8130574904837543606'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/how-to-marshal-safearray-for-adonet.html' title='How to: Marshal a SAFEARRAY for ADO.NET'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-3549059813411375259</id><published>2008-06-07T18:29:00.000-07:00</published><updated>2008-06-07T20:40:08.684-07:00</updated><title type='text'>How to: Marshal BSTR Strings for ADO.NET</title><content type='html'>&lt;span style="color:#ffff00;"&gt;Demonstrates how to add a COM string (BSTR) to a database and how to marshal a System.String from a database to a BSTR.&lt;br /&gt;ExampleIn this example, the class DatabaseClass is created to interact with an ADO.NET DataTable object. Note that this class is a native C++ class (as compared to a ref class or value class). This is necessary because we want to use this class from native code, and you cannot use managed types in native code. This class will be compiled to target the CLR, as is indicated by the #pragma managed directive preceding the class declaration. For more information on this directive, see managed, unmanaged.&lt;br /&gt;Note the private member of the DatabaseClass class: gcroot&lt;datatable&gt; table. Since native types cannot contain managed types, the gcroot keyword is necessary. For more information on gcroot, see How to: Declare Handles in Native Types.&lt;br /&gt;The rest of the code in this example is native C++ code, as is indicated by the #pragma unmanaged directive preceding main. In this example, we are creating a new instance of DatabaseClass and calling its methods to create a table and populate some rows in the table. Note that COM strings are being passed as values for the database column StringCol. Inside DatabaseClass, these strings are marshaled to managed strings using the marshaling functionality found in the System.Runtime.InteropServices namespace. Specifically, the method PtrToStringBSTR is used to marshal a BSTR to a String, and the method StringToBSTR is used to marshal a String to a BSTR.&lt;br /&gt;Note The memory allocated by StringToBSTR must be deallocated by calling either FreeBSTR or SysFreeString.// adonet_marshal_string_bstr.cpp// compile with: /clr /FU System.dll /FU System.Data.dll /FU System.Xml.dll#include &lt;comdef.h&gt;#include &lt;gcroot.h&gt;#include &lt;iostream&gt;using namespace std;&lt;br /&gt;#using &lt;system.data.dll&gt;using namespace System;using namespace System::Data;using namespace System::Runtime::InteropServices;&lt;br /&gt;#define MAXCOLS 100&lt;br /&gt;#pragma managedclass DatabaseClass{public:DatabaseClass() : table(nullptr) { }&lt;br /&gt;void AddRow(BSTR stringColValue){// Add a row to the table.DataRow ^row = table-&gt;NewRow();row["StringCol"] = Marshal::PtrToStringBSTR((IntPtr)stringColValue);table-&gt;Rows-&gt;Add(row);}&lt;br /&gt;void CreateAndPopulateTable(){// Create a simple DataTable.table = gcnew DataTable("SampleTable");&lt;br /&gt;// Add a column of type String to the table.DataColumn ^column1 = gcnew DataColumn("StringCol",Type::GetType("System.String"));table-&gt;Columns-&gt;Add(column1);}&lt;br /&gt;int GetValuesForColumn(BSTR dataColumn, BSTR *values,int valuesLength){// Marshal the name of the column to a managed// String.String ^columnStr = Marshal::PtrToStringBSTR((IntPtr)dataColumn);&lt;br /&gt;// Get all rows in the table.array&lt;datarow&gt; ^rows = table-&gt;Select();int len = rows-&gt;Length;len = (len &gt; valuesLength) ? valuesLength : len;for (int i = 0; i &lt;&gt; table;};&lt;br /&gt;#pragma unmanagedint main(){// Create a table and add a few rows to it.DatabaseClass *db = new DatabaseClass();db-&gt;CreateAndPopulateTable();&lt;br /&gt;BSTR str1 = SysAllocString(L"This is string 1.");db-&gt;AddRow(str1);&lt;br /&gt;BSTR str2 = SysAllocString(L"This is string 2.");db-&gt;AddRow(str2);&lt;br /&gt;// Now retrieve the rows and display their contents.BSTR values[MAXCOLS];BSTR str3 = SysAllocString(L"StringCol");int len = db-&gt;GetValuesForColumn(str3, values, MAXCOLS);for (int i = 0; i &lt;&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-3549059813411375259?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/3549059813411375259/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=3549059813411375259' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/3549059813411375259'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/3549059813411375259'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/how-to-marshal-bstr-strings-for-adonet.html' title='How to: Marshal BSTR Strings for ADO.NET'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-9076068538567783076</id><published>2008-06-07T18:26:00.000-07:00</published><updated>2008-06-07T20:48:13.374-07:00</updated><title type='text'>How to: Marshal ANSI Strings for ADO.NET</title><content type='html'>&lt;span style="color:#ffff00;"&gt;Demonstrates how to add a native string (char *) to a database and how to marshal a System.String from a database to a native string.&lt;br /&gt;ExampleIn this example, the class DatabaseClass is created to interact with an ADO.NET DataTable object. Note that this class is a native C++ class (as compared to a ref class or value class). This is necessary because we want to use this class from native code, and you cannot use managed types in native code. This class will be compiled to target the CLR, as is indicated by the #pragma managed directive preceding the class declaration. For more information on this directive, see managed, unmanaged.&lt;br /&gt;Note the private member of the DatabaseClass class: gcroot&lt;datatable&gt; table. Since native types cannot contain managed types, the gcroot keyword is necessary. For more information on gcroot, see How to: Declare Handles in Native Types.&lt;br /&gt;The rest of the code in this example is native C++ code, as is indicated by the #pragma unmanaged directive preceding main. In this example, we are creating a new instance of DatabaseClass and calling its methods to create a table and populate some rows in the table. Note that native C++ strings are being passed as values for the database column StringCol. Inside DatabaseClass, these strings are marshaled to managed strings using the marshaling functionality found in the System.Runtime.InteropServices namespace. Specifically, the method PtrToStringAnsi is used to marshal a char * to a String, and the method StringToHGlobalAnsi is used to marshal a String to a char *.&lt;br /&gt;Note The memory allocated by StringToHGlobalAnsi must be deallocated by calling either FreeHGlobal or GlobalFree.// adonet_marshal_string_native.cpp// compile with: /clr /FU System.dll /FU System.Data.dll /FU System.Xml.dll#include &lt;comdef.h&gt;#include &lt;gcroot.h&gt;#include &lt;iostream&gt;using namespace std;&lt;br /&gt;#using &lt;system.data.dll&gt;using namespace System;using namespace System::Data;using namespace System::Runtime::InteropServices;&lt;br /&gt;#define MAXCOLS 100&lt;br /&gt;#pragma managedclass DatabaseClass{public:DatabaseClass() : table(nullptr) { }&lt;br /&gt;void AddRow(char *stringColValue){// Add a row to the table.DataRow ^row = table-&gt;NewRow();row["StringCol"] = Marshal::PtrToStringAnsi((IntPtr)stringColValue);table-&gt;Rows-&gt;Add(row);}&lt;br /&gt;void CreateAndPopulateTable(){// Create a simple DataTable.table = gcnew DataTable("SampleTable");&lt;br /&gt;// Add a column of type String to the table.DataColumn ^column1 = gcnew DataColumn("StringCol",Type::GetType("System.String"));table-&gt;Columns-&gt;Add(column1);}&lt;br /&gt;int GetValuesForColumn(char *dataColumn, char **values,int valuesLength){// Marshal the name of the column to a managed// String.String ^columnStr = Marshal::PtrToStringAnsi((IntPtr)dataColumn);&lt;br /&gt;// Get all rows in the table.array&lt;datarow&gt; ^rows = table-&gt;Select();int len = rows-&gt;Length;len = (len &gt; valuesLength) ? valuesLength : len;for (int i = 0; i &lt;&gt; table;};&lt;br /&gt;#pragma unmanagedint main(){// Create a table and add a few rows to it.DatabaseClass *db = new DatabaseClass();db-&gt;CreateAndPopulateTable();db-&gt;AddRow("This is string 1.");db-&gt;AddRow("This is string 2.");&lt;br /&gt;// Now retrieve the rows and display their contents.char *values[MAXCOLS];int len = db-&gt;GetValuesForColumn("StringCol", values, MAXCOLS);for (int i = 0; i &lt;&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-9076068538567783076?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/9076068538567783076/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=9076068538567783076' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/9076068538567783076'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/9076068538567783076'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/how-to-marshal-ansi-strings-for-adonet.html' title='How to: Marshal ANSI Strings for ADO.NET'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-5932147173311892139</id><published>2008-06-07T18:25:00.000-07:00</published><updated>2008-06-07T20:52:04.639-07:00</updated><title type='text'>/clr (Common Language Runtime Compilation)</title><content type='html'>&lt;span style="color:#ffff00;"&gt;/clr (Common Language Runtime Compilation)&lt;br /&gt;Enables applications and components to use features from the common language runtime (CLR).&lt;br /&gt;/clr[:options]&lt;br /&gt;Arguments&lt;br /&gt;options&lt;br /&gt;One or more of the following, separated by a comma:&lt;br /&gt;/clr&lt;br /&gt;Creates metadata for your application that can be consumed by other CLR applications, and allows your application to consume types and data in the metadata of other CLR components.&lt;br /&gt;For more information, see:&lt;br /&gt;Mixed (Native and Managed) Assemblies&lt;br /&gt;How To: Migrate to /clr&lt;br /&gt;/clr:pure&lt;br /&gt;Produces an MSIL-only output file with no native executable code, although it can contain native types compiled to MSIL.&lt;br /&gt;For more information, see Pure and Verifiable Code.&lt;br /&gt;/clr:safe&lt;br /&gt;Produces an MSIL-only (no native executable code) and verifiable output file. /clr:safe enables verification diagnostics (PEVerify Tool (Peverify.exe)).&lt;br /&gt;For more information, see Writing Verifiably Type-Safe Code.&lt;br /&gt;/clr:oldSyntax&lt;br /&gt;Enables Managed Extensions for C++ syntax, the original Visual C++ syntax for CLR programming.&lt;br /&gt;Managed Extensions for C++ syntax is deprecated in Microsoft Visual C++ 2005, You should only use /clr:oldSyntax if you are maintaining a Visual C++ application that uses Managed Extensions for C++. If you are developing a new application, use the updated syntax; see New C++ Language Features for more information.&lt;br /&gt;If you have a Managed Extensions for C++ application, you can begin to port your project to use the new syntax; see Porting and Upgrading Programs for more information.&lt;br /&gt;/clr:noAssembly&lt;br /&gt;Specifies that an assembly manifest should not be inserted into the output file. By default, noAssembly is not in effect, and an assembly manifest is inserted into the output file. A managed program that does not have an assembly metadata in the manifest is called a module. See /LN (Create MSIL Module) for reasons to generate a module.&lt;br /&gt;noAssembly can only be used when a DLL is the output file of the compilation. If you compile with /c (Compile Without Linking) and /clr:noAssembly, then specify the /NOASSEMBLY (Create a MSIL Module) option in the linker phase to create a module.&lt;br /&gt;noAssembly is deprecated in Visual C++ 2005. Use /LN (Create MSIL Module) instead. For more information, see Deprecated Compiler Options.&lt;br /&gt;Before Visual C++ 2005, /clr:noAssembly implied /clr. However, /clr now also supports /clr:oldSyntax, so you must specify one /clr form when you specify /clr:noAssembly. For example, /clr:noAssembly /clr creates a module using the new Visual C++ CLR syntax and /clr:noAssembly,oldSyntax creates a module using Managed Extensions for C++.&lt;br /&gt;Before Visual C++ 2005, /clr:noAssembly required /LD. /LD is now implied with you specify /clr:noAssembly.&lt;br /&gt;/clr:initialAppDomain&lt;br /&gt;Allows a Visual C++ application to run on version 1 of the common language runtime. If you use initialAppDomain, then you may see some of the problems discussed in Knowledge Base article Q309694. You can find Knowledge Base articles on the MSDN Library media or at http://support.microsoft.com/support/.&lt;br /&gt;An application compiled with initialAppDomain should never be used by an application using ASP.NET. Upgrade to a newer runtime to do ASP.NET work with C++.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-5932147173311892139?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/5932147173311892139/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=5932147173311892139' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/5932147173311892139'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/5932147173311892139'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/clr-common-language-runtime-compilation_07.html' title='/clr (Common Language Runtime Compilation)'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-4499260297331250668</id><published>2008-06-07T18:22:00.000-07:00</published><updated>2008-06-07T20:54:36.078-07:00</updated><title type='text'>/GS (Buffer Security Check)</title><content type='html'>&lt;span style="color:#ffff00;"&gt;Detects some buffer overruns that overwrite the return address, a common technique for exploiting code that does not enforce buffer size restrictions. This is achieved by injecting security checks into the compiled code.&lt;br /&gt;/GS[-]&lt;br /&gt;Remarks&lt;br /&gt;/GS is on by default. Use /GS- if you expect your application to have no security exposure.&lt;br /&gt;For additional information on /GS see Compiler Security Checks .&lt;br /&gt;The compiler injects checks in functions with local string buffers or, on x86, functions with exception handling. A string buffer is defined as an array whose element size is one or two bytes, and where the size of the whole array is at least five bytes, or, any buffer allocated with _alloca.&lt;br /&gt;On all platforms, the compiler injects a cookie to protect the function's return address if the function has local string buffers. This cookie is checked on function exit, and during frame unwinding on 64-bit operating systems or on x86 for functions with some form of exception handling. On x86, the compiler also injects a cookie to protect the address of the function's exception handler. This cookie is checked during frame unwinding.&lt;br /&gt;/GS primarily attempts to detect direct buffer overruns into the return address. Buffer overruns are more easily exploited on machines with calling conventions that store the return address of function calls on the stack. For example, x86 uses calling conventions that store the return address of function calls on the stack.&lt;br /&gt;On functions that the compiler thinks might be subject to buffer overrun problems, the compiler will allocate space on the stack before the return address. On function entry, the allocated space is loaded with a security cookie that is computed once at module load. Then, on function exit, a helper function is called to make sure the cookie's value is still the same.&lt;br /&gt;If the value is not the same, an overwrite of the stack has potentially occurred and the process simply terminates. Prior to Visual C++ 2005 a dialog box displayed reporting the stack overwrite&lt;br /&gt;/GS also protects against vulnerable parameters passed into a function. A vulnerable parameter is a pointer, C++ reference, or a C-structure (C++ POD type) that contains a pointer, string buffer, or C++ reference.&lt;br /&gt;A vulnerable parameter is allocated before the cookie and local variables. A buffer overrun can overwrite these parameters. Code in the function that uses these parameters can lead to an attack before the function returns, thus avoiding the security check. To minimize this danger, the compiler will make a copy of the vulnerable parameters during the function prolog and put them below the storage area for any buffers.&lt;br /&gt;The compiler does not provide security protection for vulnerable parameters in the following situations:&lt;br /&gt;Functions that do not contain a buffer.&lt;br /&gt;If optimizations (/O Options (Optimize Code)) are not enabled.&lt;br /&gt;Functions with a variable argument list (...).&lt;br /&gt;Functions marked with naked (C++).&lt;br /&gt;Functions containing inline assembly code in the first statement.&lt;br /&gt;If a parameter is used only in ways that are less likely to be exploitable in the event of a buffer overrun.&lt;br /&gt;/GS requires initialization of the security cookie. This cookie must be initialized before any function using the cookie runs. The security cookie must be initialized upon entry to an EXE or DLL. This is done automatically when using the default CRT entry points (mainCRTStartup, wmainCRTStartup, WinMainCRTStartup, wWinMainCRTStartup, or _DllMainCRTStartup), but must be done manually, via a call to __security_init_cookie, if you use an alternate entry point.&lt;br /&gt;/GS is supported for managed functions when compiling with /clr (Common Language Runtime Compilation).&lt;br /&gt;/GS does not protect against all buffer overrun security attacks. For example, if you have a buffer and a vtable in an object, the buffer overrun could corrupt the vtable and allow an attack to occur.&lt;br /&gt;Even if you use /GS, you should strive to write secure code. That is, make sure that your code has no buffer overruns. /GS might protect your application from buffer overruns that do remain in your code.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-4499260297331250668?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/4499260297331250668/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=4499260297331250668' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/4499260297331250668'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/4499260297331250668'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/gs-buffer-security-check.html' title='/GS (Buffer Security Check)'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-5918435347153725066</id><published>2008-06-07T18:19:00.000-07:00</published><updated>2008-06-07T20:58:32.235-07:00</updated><title type='text'>/GR (Enable Run-Time Type Information)</title><content type='html'>&lt;span style="color:#ffff00;"&gt;Adds code to check object types at run time.&lt;br /&gt;/GR[-]&lt;br /&gt;Remarks&lt;br /&gt;When /GR is on, the compiler defines the _CPPRTTI preprocessor macro. In Visual C++ 2005, /GR is on by default. /GR- disables run-time type information.&lt;br /&gt;Use /GR if your code uses dynamic_cast Operator or typeid. /GR does, however, cause the .rdata sections of your image to increase in size. If your code does not use dynamic_cast or typeid, using /GR- may produce a smaller image.&lt;br /&gt;For more information on run-time type checking, see Run-Time Type Information in the C++ Language Reference.&lt;br /&gt;To set this compiler option in the Visual Studio development environment&lt;br /&gt;1. Open the project's Property Pages dialog box. For details, see How to: Open Project Property Pages.&lt;br /&gt;2. Click the C/C++ folder.&lt;br /&gt;3. Click the Language property page.&lt;br /&gt;4. Modify the Enable Run-Time Type Info property.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-5918435347153725066?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/5918435347153725066/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=5918435347153725066' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/5918435347153725066'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/5918435347153725066'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/gr-enable-run-time-type-information.html' title='/GR (Enable Run-Time Type Information)'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-66227074660400744</id><published>2008-06-07T18:15:00.000-07:00</published><updated>2008-06-07T21:04:07.333-07:00</updated><title type='text'>/LTCG (Link-time Code Generation)</title><content type='html'>&lt;span style="color:#ffff00;"&gt;/LTCG[:NOSTATUS:STATUS:PGINSTRUMENT:PGOPTIMIZE:PGUPDATE]&lt;br /&gt;Remarks&lt;br /&gt;where:&lt;br /&gt;:NOSTATUS :STATUS (optional)&lt;br /&gt;Specifies whether the linker should display a progress indicator showing what percentage of the link is complete. The default is to not display this status information.&lt;br /&gt;:PGINSTRUMENT (optional)&lt;br /&gt;Specifies that the linker should output a .pgd file in preparation for instrumented test runs on the application. You can optionally specify /PGD to create the .pgd file with a nondefault name or location.&lt;br /&gt;The data collected from the instrumented runs will be used to create an optimized image. For more information, see Profile Guided Optimization. The short form of this option is /LTCG:PGI.&lt;br /&gt;:PGOPTIMIZE (optional)&lt;br /&gt;Specifies that the linker should use the profile data created after running the instrumented binary to create an optimized image. All input files must be identical to the files that were specified with /LTCG:PGI. For more information, see Profile Guided Optimization. The short form of this option is /LTCG:PGO.&lt;br /&gt;:PGUPDATE (optional)&lt;br /&gt;Allows list of input files to be added or modified from what was specified in the :PGINSTRUMENT phase. However, any new input files will not be optimized with profile-guided optimizations and changed portions of a modified input file that invalidate profile data collected during the instrumentation phase for that code will not be optimized with profile-guided optimizations. For more information, see Profile Guided Optimization. The short form of this option is /LTCG:PGU.&lt;br /&gt;Remarks&lt;br /&gt;The /LTCG option tells the linker to call the compiler and perform whole program optimization. You can also do profile guided optimization. For more information, see Profile Guided Optimization.&lt;br /&gt;With the following exceptions, you cannot add additional linker options to the /LTCG:PGOPTIMIZE or /LTCG:PGUPDATE run that were not specified in the /LTCG:PGINSTRUMENT run:&lt;br /&gt;/BASE&lt;br /&gt;/FIXED&lt;br /&gt;/LTCG&lt;br /&gt;/MAP&lt;br /&gt;/MAPINFO&lt;br /&gt;/NOLOGO&lt;br /&gt;/OUT&lt;br /&gt;/PGD&lt;br /&gt;/PDB&lt;br /&gt;/PDBSTRIPPED&lt;br /&gt;/STUB&lt;br /&gt;/VERBOSE&lt;br /&gt;Any linker options specified to /LTCG:PGINSTRUMENT do not have to be specified to /LTCG:PGOPTIMIZE; they are implied.&lt;br /&gt;The rest of this topic will only discuss /LTGC in terms of link-time code generation.&lt;br /&gt;/LTCG is implied with /GL.&lt;br /&gt;The linker invokes link-time code generation if it is passed a module that was compiled with /GL or an MSIL module (see .netmodule Files as Linker Input for more information). If you do not explicitly specify /LTCG when passing /GL or MSIL modules to the linker, the linker will eventually detect this and restart the link with /LTCG. Explicitly specify /LTCG when passing /GL and MSIL modules to the linker for the fastest possible build performance.&lt;br /&gt;/LTCG is not valid for use with /INCREMENTAL.&lt;br /&gt;When /LTCG is used with either /Og, /O1, /O2, or /Ox, the following optimizations are performed:&lt;br /&gt;Cross-module inlining&lt;br /&gt;Interprocedural register allocation (64-bit operating systems only)&lt;br /&gt;Custom calling convention (x86 only)&lt;br /&gt;Small TLS displacement (x86 only)&lt;br /&gt;Stack double alignment (x86 only)&lt;br /&gt;Improved memory disambiguation (better interference information for global variables and input parameters)&lt;br /&gt;Using /LTCG and /Ogt will result in double-alignment optimization.&lt;br /&gt;If /LTCG and /Ogs are specified, double alignment will not be performed. If most of the functions in an application are compiled for speed, with a few functions compiled for size (for example, by using the optimize pragma), the compiler will double align these functions that are optimized for size if they call functions that need double alignment.&lt;br /&gt;If the compiler can identify all the call sites of a function, the compiler will ignore explicit calling-convention modifiers on a function and try to optimize the function's calling convention:&lt;br /&gt;pass parameters in registers&lt;br /&gt;reorder parameters for alignment&lt;br /&gt;remove unused parameters&lt;br /&gt;If a function is called via function pointer, or if a function make be called outside of a module compiled with /GL, the compiler will not attempt to optimize a function's calling convention.&lt;br /&gt;Note&lt;br /&gt;If you use /LTCG and redefine mainCRTStartup, your application can have unpredictable behavior relating to user code that executes before global objects are initialized. There are three ways to address this issue: do not redefine mainCRTStartup, do not compile the file containing mainCRTStartup with /LTCG, or initialize global variables and objects statically, if possible.&lt;br /&gt;/LTCG and MSIL Modules&lt;br /&gt;Modules compiled with /GL and /clr can be used as input to the linker when /LTCG is specified:&lt;br /&gt;/LTCG can accept native object files; mixed native/managed object files (compiled with /clr), pure object files (compiled with /clr:pure), and safe object files (compiled with /clr:safe)&lt;br /&gt;/LTCG can accept safe .netmodules, which can be created with /clr:safe /LN in Visual C++ and /target:module with any other Visual Studio compiler. .netmodules produced with /clr or /clr:pure are not accepted by /LTCG.&lt;br /&gt;/LTCG:PGI does not accept native modules compiled with /GL and /clr, or pure modules (produced with /clr:pure)&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-66227074660400744?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/66227074660400744/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=66227074660400744' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/66227074660400744'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/66227074660400744'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/ltcg-link-time-code-generation.html' title='/LTCG (Link-time Code Generation)'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-5070248837905349803</id><published>2008-06-07T18:13:00.000-07:00</published><updated>2008-06-07T21:06:35.943-07:00</updated><title type='text'>/CLRHEADER</title><content type='html'>&lt;span style="color:#ffff00;"&gt;/CLRHEADER file&lt;br /&gt;Remarks&lt;br /&gt;where:&lt;br /&gt;file&lt;br /&gt;An image file built with /clr.&lt;br /&gt;Remarks&lt;br /&gt;CLRHEADER displays information about the .NET headers used in any managed program. The output shows the location and size, in bytes, of the .NET header and sections in the header.&lt;br /&gt;Only the /HEADERS DUMPBIN option is available for use on files produced with the /GL compiler option.&lt;br /&gt;When /CLRHEADER is used on a file that was compiled with /clr, there will be a clr Header: section in the dumpbin output. The value of flags indicates which /clr option was used:&lt;br /&gt;0 -- /clr (image may contain native code).&lt;br /&gt;1 -- /clr:safe (image is MSIL only, able to run on any CLR platform, and possibly verifiable).&lt;br /&gt;3 -- /clr:pure (image is MSIL only, but only able to run on x86 platforms).&lt;br /&gt;You can also programmatically check if an image was built for the common language runtime. For more information, see How to: Determine if an Image is Native or CLR.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-5070248837905349803?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/5070248837905349803/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=5070248837905349803' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/5070248837905349803'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/5070248837905349803'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/clrheader.html' title='/CLRHEADER'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-7081212087439881195</id><published>2008-06-07T18:11:00.000-07:00</published><updated>2008-06-07T21:10:27.227-07:00</updated><title type='text'>/GL (Whole Program Optimization)</title><content type='html'>&lt;span style="color:#ffff00;"&gt;Enables whole program optimization.&lt;br /&gt;/GL[-]&lt;br /&gt;Remarks&lt;br /&gt;Whole program optimization allows the compiler to perform optimizations with information on all modules in the program. Without whole program optimization, optimizations are performed on a per module (compiland) basis.&lt;br /&gt;Whole program optimization is off by default and must be explicitly enabled. However, it is also possible to explicitly disable it with /GL-.&lt;br /&gt;With information on all modules, the compiler can:&lt;br /&gt;Optimize the use of registers across function boundaries.&lt;br /&gt;Do a better job of tracking modifications to global data, allowing a reduction in the number of loads and stores.&lt;br /&gt;Do a better job of tracking the possible set of items modified by a pointer dereference, reducing the numbers of loads and stores.&lt;br /&gt;Inline a function in a module even when the function is defined in another module.&lt;br /&gt;.obj files produced with /GL will not be available to such linker utilities as EDITBIN Reference and DUMPBIN Reference.&lt;br /&gt;If you compile your program with /GL and /c (Compile Without Linking), you should use the /LTCG linker option to create the output file.&lt;br /&gt;/Z7, /Zi, /ZI (Debug Information Format) cannot be used with /GL&lt;br /&gt;The format of files produced with /GL in the current version may not be readable by subsequent versions of Visual C++. You should not ship a .lib file comprised of .obj files that were produced with /GL unless you are willing to ship copies of the .lib file for all versions of Visual C++ you expect your users to use, now and in the future.&lt;br /&gt;.obj files produced with /GL and precompiled header files should not be used to build a .lib file unless the .lib file will be linked on the same machine that produced the /GL .obj file. Information from the .obj file's precompiled header file will be needed at link time.&lt;br /&gt;For more information on the optimizations available with and the limitations of whole program optimization, see/LTCG (Link-time Code Generation). /GL also makes profile guided optimization available; see /LTCG. When compiling for profile guided optimizations and if you want function ordering from your profile guided optimizations, you must compile with /Gy (Enable Function-Level Linking) or a compiler option that implies /Gy.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-7081212087439881195?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/7081212087439881195/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=7081212087439881195' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/7081212087439881195'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/7081212087439881195'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/gl-whole-program-optimization.html' title='/GL (Whole Program Optimization)'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-3707063887503795433</id><published>2008-06-07T18:06:00.000-07:00</published><updated>2008-06-07T21:15:36.399-07:00</updated><title type='text'>/GF (Eliminate Duplicate Strings)</title><content type='html'>&lt;span style="color:#ffff00;"&gt;Enables the compiler to create a single copy of identical strings in the program image and in memory during execution, resulting in smaller programs, an optimization called string pooling.&lt;br /&gt;/GF&lt;br /&gt;Remarks&lt;br /&gt;/GF pools strings as read-only.&lt;br /&gt;If you use /GF, the operating system does not swap the string portion of memory and can read the strings back from the image file. If you try to modify strings under /GF, an application error occurs.&lt;br /&gt;String pooling allows what were intended as multiple pointers to multiple buffers to be as multiple pointers to a single buffer. In the following code, s and t are initialized with the same string. String pooling causes them to point to the same memory:&lt;br /&gt;char *s = "This is a character buffer";&lt;br /&gt;char *t = "This is a character buffer";&lt;br /&gt;Note&lt;br /&gt;The/Z7, /Zi, /ZI (Debug Information Format) option, used for Edit and Continue, automatically sets the /GF option.&lt;br /&gt;/GF is in effect when/O1, /O2 (Minimize Size, Maximize Speed) or /O2 is used.&lt;br /&gt;To set this compiler option in the Visual Studio development environment&lt;br /&gt;1. Open the project's Property Pages dialog box. For details, see How to: Open Project Property Pages.&lt;br /&gt;2. Click the C/C++ folder.&lt;br /&gt;3. Click the Code Generation property page.&lt;br /&gt;4. Modify the Enable String Pooling property.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-3707063887503795433?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/3707063887503795433/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=3707063887503795433' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/3707063887503795433'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/3707063887503795433'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/gf-eliminate-duplicate-strings.html' title='/GF (Eliminate Duplicate Strings)'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-1824971672888118575</id><published>2008-06-07T18:03:00.000-07:00</published><updated>2008-06-07T21:20:05.380-07:00</updated><title type='text'>/G (Optimize for Processor) Options</title><content type='html'>&lt;span style="color:#ffff00;"&gt;Tells the compiler to optimize code generation for the specified processor.&lt;br /&gt;/G{12}&lt;br /&gt;Arguments&lt;br /&gt;/G1&lt;br /&gt;Optimize for Itanium processor. Only available in the Itanium cross compiler or Itanium native compiler.&lt;br /&gt;/G2&lt;br /&gt;Optimize for Itanium2 processor (default between /G1 and /G2) Only available in the Itanium cross compiler or Itanium native compiler.&lt;br /&gt;/G is available in all editions of Visual C++, but the compiler can perform more optimizations when /G is used with one of the /O compiler options. However, /O is not available in the Visual C++ standard edition.&lt;br /&gt;To set this compiler option in the Visual Studio development environment&lt;br /&gt;1. Open the project's Property Pages dialog box. For details, see How to: Open Project Property Pages.&lt;br /&gt;2. Click the C/C++ folder.&lt;br /&gt;3. Click the Command Line property page.&lt;br /&gt;4. Type the compiler option in the Additional Options box.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-1824971672888118575?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/1824971672888118575/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=1824971672888118575' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/1824971672888118575'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/1824971672888118575'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/g-optimize-for-processor-options.html' title='/G (Optimize for Processor) Options'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-7457318286146652869</id><published>2008-06-07T18:02:00.000-07:00</published><updated>2008-06-07T21:24:55.495-07:00</updated><title type='text'>/fp (Specify Floating-Point Behavior)</title><content type='html'>&lt;span style="color:#ffff00;"&gt;Specifies floating-point behavior in a source code file.&lt;br /&gt;/fp:[precise except[-] fast strict ]&lt;br /&gt;Flags&lt;br /&gt;precise&lt;br /&gt;The default.&lt;br /&gt;Improves the consistency of floating-point tests for equality and inequality by disabling optimizations that could change the precision of floating-point calculations, which is required for strict ANSI conformance. By default, the compiler uses the coprocessor's 80-bit registers to hold the intermediate results of floating-point calculations. This increases program speed and decreases program size. Because the calculation involves floating-point data types that are represented in memory by less than 80 bits, however, carrying the extra bits of precision (80 bits minus the number of bits in a smaller floating-point type) through a lengthy calculation can produce inconsistent results.&lt;br /&gt;With /fp:precise on x86 processors, the compiler will perform rounding on variables of type float to the proper precision for assignments and casts and when passing parameters to a function. This rounding guarantees that the data does not retain any significance greater than the capacity of its type. A program compiled with /fp:precise can be slower and larger than one compiled without /fp:precise. /fp:precise disables intrinsics; the standard run-time library routines are used instead. For more information, see /Oi (Generate Intrinsic Functions).&lt;br /&gt;The following floating-point behavior is enabled with /fp:precise:&lt;br /&gt;Contractions, or replacing multiple operations with one composite operation with only a single rounding at the end, is enabled with /fp:precise.&lt;br /&gt;Expression optimizations that are invalid for special values (NaN, +infinity, -infinity, +0, -0) will not be allowed. The optimizations x-x =&gt; 0, x*0 =&gt; 0, x-0 =&gt; x, x+0 =&gt; x, and 0-x =&gt; -x are all invalid for various reasons (see IEEE 754 and the C99 standard).&lt;br /&gt;The compiler will properly handle comparisons involving NaN. For example, x != x evaluates to true if x is NaN and ordered comparisons involving NaN raise an exception.&lt;br /&gt;Expression evaluation will follow the C99 FLT_EVAL_METHOD=2, with one exception. When programming for x86 processors, because the FPU is set to 53-bit precision, this will be considered long double precision.&lt;br /&gt;Multiplication by exactly 1.0 transformed into a use of the other factor. x*y*1.0 is transformed into x*y. Similarly, x*1.0*y is transformed into x*y.&lt;br /&gt;Division by exactly 1.0 is transformed into a use of the dividend. x*y/1.0 is transformed into x*y. Similarly, x/1.0*y is transformed into x*y.&lt;br /&gt;Using /fp:precise with fenv_access ON disables some optimizations such as compile-time evaluations of floating point expressions. For example, if you change rounding mode with _control87, _controlfp, __control87_2, and the compiler performs a floating-point calculation, the rounding mode you specified will not be in effect unless fenv_access is ON.&lt;br /&gt;/fp:precise replaces the /Op compiler option.&lt;br /&gt;fast&lt;br /&gt;Creates the fastest code in the majority of cases. /fp:fast cannot be used with /fp:strict or /fp:precise, the last option specified on the command line will be used. /fp:fast and /fp:except will generate a compiler error.&lt;br /&gt;Selecting /Za, /Ze (Disable Language Extensions) (ANSI compatibility) and /fp:fast may result in unexpected behavior. For example, single-precision floating-point operations may not be rounded to single precision.&lt;br /&gt;except[-]&lt;br /&gt;Reliable floating-point exception model. Exceptions will be raised immediately after they are triggered. This option is off by default. Appending a minus sign to the option explicitly disables it.&lt;br /&gt;strict&lt;br /&gt;The strictest floating-point model. /fp:strict causes fp_contract to be OFF and fenv_access to be ON. /fp:except is implied and can be disabled by explicitly specifying /fp:except-. When used with /fp:except-, /fp:strict enforces strict floating-point semantics but without respect for exceptional events.&lt;br /&gt;Remarks&lt;br /&gt;Multiple /fp options can be specified in the same compilation.&lt;br /&gt;To control floating-point behavior by function, see the float_control pragma.&lt;br /&gt;Most of the floating-point optimizations related to /fp:strict, /fp:except (and its corresponding pragmas), and fp_contract pragma are machine dependent. /fp:strict and /fp:except are not compatible with /clr.&lt;br /&gt;/fp:precise should address most of an application's floating-point requirements. If necessary, you can use /fp:except and /fp:strict, but there may be some decrease in performance. If performance is most important, you may want to use /fp:fast.&lt;br /&gt;fp:strict, /fp:fast, and /fp:precise are precision (correctness) modes. Only one can be in effect at a time. If /fp:strict and /fp:precise are specified, the compiler use the one that it processes last. You cannot specify both /fp:strict and /fp:fast.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-7457318286146652869?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/7457318286146652869/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=7457318286146652869' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/7457318286146652869'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/7457318286146652869'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/fp-specify-floating-point-behavior.html' title='/fp (Specify Floating-Point Behavior)'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-7781723295348409365</id><published>2008-06-07T18:00:00.000-07:00</published><updated>2008-06-07T21:30:53.311-07:00</updated><title type='text'>/FC (Full Path of Source Code File in Diagnostics)</title><content type='html'>&lt;span style="color:#ffff00;"&gt;Causes the compiler to display the full path of source code files passed to the compiler in diagnostics.&lt;br /&gt;/FC&lt;br /&gt;Remarks&lt;br /&gt;Consider the following code sample:&lt;br /&gt;// compiler_option_FC.cpp&lt;br /&gt;int main( ) {&lt;br /&gt;int i // C2143&lt;br /&gt;}&lt;br /&gt;Without /FC, the diagnostic text would look similar to this diagnostic text:&lt;br /&gt;compiler_option_FC.cpp(5) : error C2143: syntax error : missing ';' before '}'&lt;br /&gt;With /FC, the diagnostic text would look similar to this diagnostic text:&lt;br /&gt;c:\test\compiler_option_FC.cpp(5) : error C2143: syntax error : missing ';' before '}'&lt;br /&gt;/FC is also needed if you want to see the full path of a file name when using the __FILE__ macro. See Predefined Macros for more information on __FILE__.&lt;br /&gt;To set this compiler option in the Visual Studio development environment&lt;br /&gt;1. Open the project's Property Pages dialog box. For details, see How to: Open Project Property Pages.&lt;br /&gt;2. Expand the Configuration Properties node.&lt;br /&gt;3. Expand the C/C++ node.&lt;br /&gt;4. Select the Advanced property page.&lt;br /&gt;5. Modify the Use Full Paths property.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-7781723295348409365?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/7781723295348409365/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=7781723295348409365' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/7781723295348409365'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/7781723295348409365'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/fc-full-path-of-source-code-file-in.html' title='/FC (Full Path of Source Code File in Diagnostics)'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-973815730896907483</id><published>2008-06-07T17:58:00.000-07:00</published><updated>2008-06-07T21:35:42.687-07:00</updated><title type='text'>/FA, /Fa (Listing File)</title><content type='html'>&lt;span style="color:#ffff00;"&gt;Creates a listing file containing assembly code.&lt;br /&gt;/FA[csu]&lt;br /&gt;/Fapathname&lt;br /&gt;Remarks&lt;br /&gt;The arguments control the generation of source code and machine code and the extension of the listing file.&lt;br /&gt;/favor:AMD64 optimizes the generated code for the AMD Opteron, and Athlon processors supporting 64-bit extensions, typically resulting in better performance for that platform. The resulting code can run on all x64 compatible platforms. Code generated with /favor:AMD64 could result in worse performance on Intel processors supporting EM64T.&lt;br /&gt;The following table describes the various values to /FA. It is possible to specify more than one value to /FA. For example, you can specify /FAsu.&lt;br /&gt;/FA = Assembly code; .asm&lt;br /&gt;/FAc = Machine and assembly code; .cod&lt;br /&gt;/FAs = Source and assembly code; .asm If /FAcs is specified, the file extension will be .cod&lt;br /&gt;/FAu = Causes the output file to be created in UTF-8 format, with a byte order marker. By default, the file encoding is ANSI, but use /FAu if you want a listing file that displays correctly on any system, or if you are using Unicode source code files as input to the compiler.&lt;br /&gt;If /FAsu is specified, and if a source code file uses Unicode encoding other than UTF-8, then the code lines in the .asm file may not display correctly.&lt;br /&gt;By default, the listing file gets the same base name as the source file. You can change the name of the listing file and the directory where it is created using the /Fa option.&lt;br /&gt;/Fa = One source_file.asm is created for each source code file in the compilation.&lt;br /&gt;/Fafilename = filename.asm is placed in the current directory. Only valid when compiling a single source code file.&lt;br /&gt;/Fafilename.extension = filename.extension is placed in the current directory. Only valid when compiling a single source code file.&lt;br /&gt;/Fadirectory\ = One source_file.asm is created and placed in the specified directory for each source code file in the compilation. Note the required trailing backslash. Only paths on the current disk are allowed.&lt;br /&gt;/Fadirectory\filename = filename.asm is placed in the specified directory. Only valid when compiling a single source code file.&lt;br /&gt;/Fadirectory\filename.extension = filename.extension is placed in the specified directory. Only valid when compiling a single source code file.&lt;br /&gt;To set this compiler option in the Visual Studio development environment&lt;br /&gt;1. Open the project's Property Pages dialog box. For details, see Setting Visual C++ Project Properties.&lt;br /&gt;2. Click the C/C++ folder.&lt;br /&gt;3. Click the Output Files property page.&lt;br /&gt;4. Modify the ASM List Location (/Fa) or Assembler Output (/FA) property (/FAu must be specified in the Command Line property page, Additional Options box..&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-973815730896907483?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/973815730896907483/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=973815730896907483' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/973815730896907483'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/973815730896907483'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/fa-fa-listing-file.html' title='/FA, /Fa (Listing File)'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-2953119130575585622</id><published>2008-06-07T17:57:00.000-07:00</published><updated>2008-06-07T21:40:22.679-07:00</updated><title type='text'>/favor (Optimize for 64)</title><content type='html'>&lt;span style="color:#ffff00;"&gt;/favor:option is available only in the x64 compiler and produces the code that is optimized for a specific x64 architecture or for the specifics of micro-architectures in both the AMD64 and Extended Memory 64 Technology (EM64T) architectures.&lt;br /&gt;/favor:blend&lt;br /&gt;/favor:AMD64&lt;br /&gt;/favor:EM64T&lt;br /&gt;Remarks&lt;br /&gt;/favor:blend produces the code that is optimized for the specifics of micro-architectures in both the AMD64 and EM64T architectures. While /favor:blend may not give the best performance possible on a specific processor, it is designed to give the best performance across a broad range of x64 processors. /favor:blend is in effect by default.&lt;br /&gt;/favor:AMD64 optimizes the generated code for the AMD Opteron, and Athlon processors supporting 64-bit extensions, typically resulting in better performance for that platform. The resulting code can run on all x64 compatible platforms. Code generated with /favor:AMD64 could result in worse performance on Intel processors supporting EM64T.&lt;br /&gt;/favor:EM64T is available only in the x64 compiler and optimizes the generated code for Intel processors supporting EM64T, typically resulting in better performance for that platform. The resulting code can run on any x64 platform. Code generated with /favor:EM64T could result in worse performance on AMD Opteron, and Athlon processors supporting 64-bit extensions.&lt;br /&gt;To set this compiler option in the Visual Studio development environment&lt;br /&gt;1. Open the project's Property Pages dialog box. For details, see How to: Open Project Property Pages.&lt;br /&gt;2. Click the C/C++ folder.&lt;br /&gt;3. Click the Command Line property page.&lt;br /&gt;4. Type the compiler option in the Additional Options box.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-2953119130575585622?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/2953119130575585622/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=2953119130575585622' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/2953119130575585622'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/2953119130575585622'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/favor-optimize-for-64.html' title='/favor (Optimize for 64)'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-7703863041209618970</id><published>2008-06-07T17:55:00.000-07:00</published><updated>2008-06-07T21:42:50.318-07:00</updated><title type='text'>/errorReport (Report Internal Compiler Errors)</title><content type='html'>&lt;span style="color:#ffff00;"&gt;Allows you to provide internal compiler error (ICE) information directly to the Visual C++ team.&lt;br /&gt;/errorReport:[ none prompt queue send ]&lt;br /&gt;Arguments&lt;br /&gt;none&lt;br /&gt;Reports about internal compiler errors will not be collected or sent to Microsoft.&lt;br /&gt;prompt&lt;br /&gt;Prompts you to send a report when you receive an internal compiler error. prompt is the default when compiling an application in the development environment.&lt;br /&gt;queue&lt;br /&gt;Queues the error report. When you log in with administrator privileges, a pop-up window is displayed and allows you to report any failures since the last time you were logged in (you will not be prompted to send reports for failures more than once every three days). queue is the default when compiling an application at the command line.&lt;br /&gt;send&lt;br /&gt;Automatically sends reports of internal compiler errors to Microsoft. To enable this option, you must first agree to Microsoft’s data collection policy. The first time you specify /errorReport:send on a computer, a compiler message will refer you to a website that contains Microsoft’s data collection policy.&lt;br /&gt;Remarks&lt;br /&gt;An internal compiler error (ICE) results when the compiler cannot process a source code file. When an ICE occurs, the compiler does not produce an output file or any useful diagnostic that you can use to fix your code.&lt;br /&gt;In previous releases, when you got an ICE, you were encouraged to call Microsoft technical support to report the problem. With /errorReport, you can provide ICE information directly to the Visual C++ team. Your error reports can help improve future compiler releases.&lt;br /&gt;A user's ability to send reports depends on machine and user policy permissions.&lt;br /&gt;To set this compiler option in the Visual Studio development environment&lt;br /&gt;1. Open the project's Property Pages dialog box. For more information, see How to: Open Project Property Pages.&lt;br /&gt;2. Click the C/C++ folder.&lt;br /&gt;3. Click the Advanced property page.&lt;br /&gt;4. Modify the Error Reporting property.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-7703863041209618970?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/7703863041209618970/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=7703863041209618970' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/7703863041209618970'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/7703863041209618970'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/errorreport-report-internal-compiler.html' title='/errorReport (Report Internal Compiler Errors)'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-5152038653868191103</id><published>2008-06-07T17:45:00.001-07:00</published><updated>2008-06-07T21:46:14.271-07:00</updated><title type='text'>/EH (Exception Handling Model)</title><content type='html'>&lt;span style="color:#ffff00;"&gt;Specifies the model of exception handling to be used by the compiler.&lt;br /&gt;/EH{sa}[c][-]&lt;br /&gt;Arguments&lt;br /&gt;a&lt;br /&gt;The exception-handling model that catches asynchronous (structured) exceptions and tells the compiler to assume that extern C functions do throw an exception.&lt;br /&gt;s&lt;br /&gt;The exception-handling model that does not catch asynchronous exceptions and tells the compiler to assume that extern C functions do throw an exception.&lt;br /&gt;c&lt;br /&gt;If used with a, the exception-handling model that catches asynchronous exceptions. If used with s, the exception-handling model that does not catch asynchronous exceptions. In both cases, c tells the compiler to assume that extern C functions never throw an exception&lt;br /&gt;Remarks&lt;br /&gt;Use /EHs to specify the synchronous exception handling model (C++ exception handling without structured exception handling exceptions). If you use /EHs, then your catch clause will not catch asynchronous exceptions. Also, in Visual C++ 2005, all objects in scope when the asynchronous exception is generated will not be destroyed even if the asynchronous exception is handled. Under /EHs, catch(...) will only catch C++ exceptions. Access violations and System.Exception exceptions will not be caught.&lt;br /&gt;Use /EHa to specify the asynchronous exception handling model (C++ exception handling with structured exception handling exceptions). /EHa may result in a less performant image because the compiler will not optimize a catch block as aggressively, even if the compiler does not see a throw.&lt;br /&gt;Use /EHa if you want to catch an exception raised with something other than a throw. The following sample will generate an exception:&lt;br /&gt;// compiler_options_EHA.cpp&lt;br /&gt;// compile with: /EHa&lt;br /&gt;#include &lt;iostream&gt;&lt;br /&gt;#include &lt;excpt.h&gt;&lt;br /&gt;using namespace std;&lt;br /&gt;void fail() { // generates SE and attempts to catch it using catch(...)&lt;br /&gt;try {&lt;br /&gt;int i = 0, j = 1;&lt;br /&gt;j /= i; // This will throw a SE (divide by zero).&lt;br /&gt;}&lt;br /&gt;catch(...) { // catch block will only be executed under /EHa&lt;br /&gt;cout&lt;&lt;"Caught an exception in catch(...)."&lt; } } int main() { __try { fail(); } // __except will only catch an exception here __except(EXCEPTION_EXECUTE_HANDLER) { // if the exception was not caught by the catch(...) inside fail() cout &lt;&lt; "An exception was caught in __except." &lt;&lt;&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-5152038653868191103?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/5152038653868191103/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=5152038653868191103' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/5152038653868191103'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/5152038653868191103'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/eh-exception-handling-model.html' title='/EH (Exception Handling Model)'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-4818652950329091479</id><published>2008-06-07T17:45:00.000-07:00</published><updated>2008-06-07T21:49:08.073-07:00</updated><title type='text'>Double Thunking (C++)</title><content type='html'>&lt;span style="color:#ffff00;"&gt;Double thunking refers to the loss of performance you can experience when a function call in a managed context calls a C++ managed function and where program execution calls the function's native entry point in order to call the managed function. This topic discusses where double thunking occurs and how you can avoid it to improve performance.&lt;br /&gt;Remarks&lt;br /&gt;By default, when compiling with /clr (not /clr:pure), the definition of a managed function causes the compiler to generate a managed entry point and a native entry point. This allows the managed function to be called from native and managed call sites. However, when a native entry point exists, it can be the entry point for all calls to the function. If a calling function is managed, the native entry point will then call the managed entry point. In effect, two calls are required to invoke the function (hence, double thunking). For example, virtual functions are always called through a native entry point.&lt;br /&gt;One resolution is to tell the compiler not to generate a native entry point for a managed function, that the function will only be called from a managed context, by using the __clrcall calling convention.&lt;br /&gt;Similarly, if you export (dllexport, dllimport) a managed function, a native entry point is generated and any function that imports and calls that function will call through the native entry point. To avoid double thunking in this situation, do not use native export/import semantics; simply reference the metadata via #using (see The #using Directive).&lt;br /&gt;In Visual C++ 2005 the compiler was updated to reduce unnecessary double thunking. For example, any function with a managed type in the signature (including return type) will implicitly be marked as __clrcall. For more information on double thunk elimination&lt;br /&gt;Example&lt;br /&gt;The following sample demonstrates double thunking. When compiled native (without /clr), the call to the virtual function in main generates one call to T's copy constructor and one call to the destructor. Similar behavior is achieved when the virtual function is declared with /clr and __clrcall. However, when just compiled with /clr, the function call generates a call to the copy constructor but there is another call to the copy constructor due to the native-to-managed thunk.&lt;br /&gt;// double_thunking.cpp&lt;br /&gt;// compile with: /clr&lt;br /&gt;#include &lt;stdio.h&gt;&lt;br /&gt;struct T {&lt;br /&gt;T() {&lt;br /&gt;puts(__FUNCSIG__);&lt;br /&gt;}&lt;br /&gt;T(const T&amp;amp;) {&lt;br /&gt;puts(__FUNCSIG__);&lt;br /&gt;}&lt;br /&gt;~T() {&lt;br /&gt;puts(__FUNCSIG__);&lt;br /&gt;}&lt;br /&gt;T&amp;amp; operator=(const T&amp;amp;) {&lt;br /&gt;puts(__FUNCSIG__);&lt;br /&gt;return *this;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;struct S {&lt;br /&gt;virtual void /* __clrcall */ f(T t) {};&lt;br /&gt;} s;&lt;br /&gt;int main() {&lt;br /&gt;S* pS = &amp;s;&lt;br /&gt;T t;&lt;br /&gt;printf("calling struct S\n");&lt;br /&gt;pS-&gt;f(t);&lt;br /&gt;printf("after calling struct S\n");&lt;br /&gt;}&lt;br /&gt;Sample Output&lt;br /&gt;__thiscall T::T(void)&lt;br /&gt;calling struct S&lt;br /&gt;__thiscall T::T(const struct T &amp;amp;)&lt;br /&gt;__thiscall T::T(const struct T &amp;amp;)&lt;br /&gt;__thiscall T::~T(void)&lt;br /&gt;__thiscall T::~T(void)&lt;br /&gt;after calling struct S&lt;br /&gt;__thiscall T::~T(void)&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6064719148837444379-4818652950329091479?l=cplusplussourcecode.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://cplusplussourcecode.blogspot.com/feeds/4818652950329091479/comments/default' title='ส่งความคิดเห็น'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6064719148837444379&amp;postID=4818652950329091479' title='0 ความคิดเห็น'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/4818652950329091479'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6064719148837444379/posts/default/4818652950329091479'/><link rel='alternate' type='text/html' href='http://cplusplussourcecode.blogspot.com/2008/06/double-thunking-c.html' title='Double Thunking (C++)'/><author><name>Valentines Flower</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6064719148837444379.post-2381682849036533215</id><published>2008-06-07T17:43:00.000-07:00</published><updated>2008-06-07T22:08:37.960-07:00</updated><title type='text'>/clr (Common Language Runtime Compilation)</title><content type='html'>&lt;span style="color:#ffff00;"&gt;Enables applications and components to use features from the common language runtime (CLR).&lt;br /&gt;/clr[:options]&lt;br /&gt;Arguments&lt;br /&gt;options&lt;br /&gt;One or more of the following, separated by a comma:&lt;br /&gt;/clr&lt;br /&gt;Creates metadata for your application that can be consumed by other CLR applications, and allows your application to consume types and data in the metadata of other CLR components.&lt;br /&gt;For more information, see:&lt;br /&gt;Mixed (Native and Managed) Assemblies&lt;br /&gt;How To: Migrate to /clr&lt;br /&gt;/clr:pure&lt;br /&gt;Produces an MSIL-only output file with no native executable code, although it can contain native types compiled to MSIL.&lt;br /&gt;For more information, see Pure and Verifiable Code.&lt;br /&gt;/clr:safe&lt;br /&gt;Produces an MSIL-only (no native executable code) and verifiable output file. /clr:safe enables verification diagnostics (PEVerify Tool (Peverify.exe)).&lt;br /&gt;For more information, see Writing Verifiably Type-Safe Code.&lt;br /&gt;/clr:oldSyntax&lt;br /&gt;Enables Managed Extensions for C++ syntax, the original Visual C++ syntax for CLR programming.&lt;br /&gt;Managed Extensions for C++ syntax is deprecated in Microsoft Visual C++ 2005, You should only use /clr:oldSyntax if you are maintaining a Visual C++ application that uses Managed Extensions for C++. If you are developing a new application, use the updated syntax; see New C++ Language Features for more information.&lt;br /&gt;If you have a Managed Extensions for C++ application, you can begin to port your project to use the new syntax; see Porting and Upgrading Programs for more information.&lt;br /&gt;/clr:noAssembly&lt;br /&gt;Specifies that an assembly manifest should not be inserted into the
