Skip to main content

Posts

Featured Post

How to create customizable products in Shopify for Free (No coding!)

Creating customizable products in your Shopify store not only increase your customer satisfaction, it also increases your conversion rate.  Here is a method to add custom options for your Shopify product and convert it into personalized product - Go to Shopify store page and search for "Advanced Product Customizer" app or you can directly the the Shopify app page by clicking on this link Advanced Product Customizer . Install  Advanced Product Customizer  app for free in your Shopify store  From the application dashboard, enable to app embed block to complete the installation process Click "Product Custom Options"  From the Shopify products list, select the product on which you want to add custom options. Advanced Product Customizer  offers Image Swatch, Color Swatch, Text box, File Upload, Radio, Checkbox, Date Picker and more. Here is the a demo video for adding custom option for a Shopify product -

Add Combo box in a cell of DataGridView at Run Time - C#.NET Windows Form

In DataGridView control of windows form we can set the column type " DataGridViewComboBoxColumn " to show combo box in the cells of the column. Sometimes we need to show only a single or few cells having combo box. For this we need to add Combo box to the required cell on run time. Here is the sample code to do the same - //to get the correct cell get value of row and column indexs of the cell  ColIndex = 1;  RowIndex = 1;  DataGridViewComboBoxCell ComboBoxCell = new DataGridViewComboBoxCell();  ComboBoxCell.Items.AddRange("XYZ", "ABC", "PQR");  ComboBoxCell.Value = "XYZ";  datagridview1[ColIndex, RowIndex] = ComboBoxCell; From the above code DataGirdCell at the location (1,1) will be converted to a "DataGridViewComboBoxCell" and combo box will be shown in the cell. It might be possible that to dropdown the combo box multiple mouse clicks are required. To activate combo box on single click fol...

Drawing Custom Border Color on a Control in C#.NET Windows Form Application

Sometimes we need to change the border color of a control to match its color with UI. Visual studio designer only allows us to choose borderStyle. To change border color of controls (like panel, DataGrid etc.) we need to write custom code to set the border color of control. Here is the custom code -   private void ControlBorder_Paint(object sender, PaintEventArgs e)         {             try             {                 Control ctrl = sender as Control;                 ControlPaint.DrawBorder(e.Graphics, ctrl.ClientRectangle,                   Color.FromArgb(130, 135,144), ButtonBorderStyle.Solid);                           }             catch (Exception ex)     ...

Create a Custom Tooltip dialog from a Form C# Windows Form Application

  T o show information on any button we can use a form and custom format it to show use it as a tooltip. For example to explain any functionality related to some section we have a long tooltip message. Here we can create a custom tooltip dialog that can show the message in more user friendly way.   To create a custom formatted dialog create a form with following settings -     namespace Project1 { public partial class frmCustomToolTipDlg : Form {   public frmCustomToolTipDlg() { InitializeComponent(); this .FormBorderStyle = FormBorderStyle.None; this .BackColor = Color.FromArgb(50, 50, 50); this .Opacity = 0; fadeTimer = new Timer { Interval = 15, Enabled = true }; fadeTimer.Tick += new EventHandler(fadeTimer_Tick); } void fadeTimer_Tick( object sender, EventArgs e) { ...

Create word documents in C#.NET using Spire.Doc .NET library

Create word documents in C#.NET using Spire.Doc .NET library Sometimes in our application we need to create word documents where we can create different types of documents and can perform many operations them related to formatting, conversion etc. Spire.Doc is a .NET library where we can create, read, write, convert and print Word documents files using .NET platform (C#, B.NET, ASP.NET). Here we do not require Microsoft word to be installed on the system. But we will need MS Word viewer to view resultant document. Spire.Doc also gives us the functionlities to convert document files to XML, RYF, TXT, XPS, EPUB, EMF, HTML, PDF and vice versa. Here we will discuss creating a word document using Spire.Doc library in  C#.NET forms and its conversion to PDF file format. Setup of Spire.Doc can be downloaded from http://www.e-iceblue.com/Download/download-word-for-net-now.html . After installing Spire.Doc library add  SpireDoc.dll in reference of the project. Choose suitable...

Access 64-bit HKLM\Software registry by 32-bit C#.NET application

Access 64-bit HKLM\Software registry by 32-bit C#.NET application While running 32-bit windows application on a 64-bit windows OS their is a registry redirection. Here if 32-bit application try to read a key under HKLM\Software, then due to Registry redirection effective path becomes HKLM\Software\Wow6432Node. For example, we are running 64-bit and 32-bit application to read registry keys as HKLM\Software\xyz and HKLM\Software\Wow6432Node\xyz So by default with an input of HKLM\Software, 64-bit application will read HKLM\Software\xyz while because of registry redirection 32-bit application will read HKLM\Software\Wow6432Node\xyz. In C#, to read 64-bit HKLM\Software registry keys we can use RegistryKey.OpenBaseKey method . This method takes two arguments- RegistryHive and RegistryView. Here sperate registry views are present for 32-bit and 64-bit. Here is the sample C# code to read AppPaths for 32-bit and 64-bit applications installed on the system - try     ...

Extract icons of Installed Windows Application using C#. NET

Icon of Installed Windows Applications First we need to figure out the location of icon for the installed windows application. This information is stored in registry at following locations - 1. Key name - HEKY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall    Value    - DisplayIcon 2. Key name - HKEY_CLASSES_ROOT\Installer\Products\{productID}    Value - ProductIcon first try to get location of icon from HEKY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall. Here if the value of DisplayIcon is null then try to fetch location of icon from HKEY_CLASSES_ROOT\Installer\Products\{productID} Here is the sample code to read the icon - CodeProject using system.Drawing // read HKEY_LOCAL_MACHINE Icon ProductIcon; private void ReadIcon() { try { string uninstallKey = @" SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall" ; using (RegistryKey rk = Registry.LocalMachine.OpenSubKey(...

Continue executing code after calling ShowDialog() using C#

In  C# windows form application using ShowDialog() a user can show a form as modal dialog. Here we cannot access the rest application or continue execution of the code until the modal dialog is closed. Sometimes we need to show modal dialog to user and we need to perform some background operations with parent form control without closing the dialog box. For example - we are doing some calculation and on the basis of these calculation we are moving the progress bar control on dialog box. Here is the c# code by which user can continue executing code after showing modal dialog using ShowDialog() - ReaderWriterLockSlim ScanLock = new ReaderWriterLockSlim(); private void Form1_Load ( object sender, EventArgs e) { ScanLock.EnterWriteLock(); UIThread(()=> { WindowsFormsSynchronizationContext.Current.Post(_ => { Form2 frm = new Form2(); frm.ShowDialo...