Click here to Skip to main content
15,895,011 members
Articles / Desktop Programming / Windows Forms

A Simple Way to Operate Multiple Controls at Runtime

Rate me:
Please Sign up or sign in to vote.
4.75/5 (11 votes)
16 Oct 2009CPOL2 min read 24.1K   218   24  
This article presents a simple solution to operate multiple UI elements at runtime depending on one condition
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <ProjectGuid>{12EA4DA8-6DB9-4F14-A5B8-8C38FE6A29B3}</ProjectGuid>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <OutputType>WinExe</OutputType>
    <RootNamespace>BindingTest</RootNamespace>
    <AssemblyName>BindingTest</AssemblyName>
    <TargetFrameworkVersion>v2.0</TargetFrameworkVersion>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <SourceAnalysisOverrideSettingsFile>C:\Documents and Settings\lapin_vm\Application Data\ICSharpCode/SharpDevelop3.0\Settings.SourceAnalysis</SourceAnalysisOverrideSettingsFile>
    <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
    <NoStdLib>False</NoStdLib>
    <WarningLevel>4</WarningLevel>
    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Platform)' == 'x86' ">
    <PlatformTarget>x86</PlatformTarget>
    <RegisterForComInterop>False</RegisterForComInterop>
    <GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies>
    <BaseAddress>4194304</BaseAddress>
    <FileAlignment>4096</FileAlignment>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
    <OutputPath>bin\Debug\</OutputPath>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>Full</DebugType>
    <Optimize>False</Optimize>
    <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
    <DefineConstants>DEBUG;TRACE</DefineConstants>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
    <OutputPath>bin\Release\</OutputPath>
    <DebugSymbols>False</DebugSymbols>
    <DebugType>None</DebugType>
    <Optimize>True</Optimize>
    <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
    <DefineConstants>TRACE</DefineConstants>
  </PropertyGroup>
  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
  <ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Windows.Forms" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="DerivedProperties.cs" />
    <Compile Include="MainForm.cs" />
    <Compile Include="MainForm.Designer.cs">
      <DependentUpon>MainForm.cs</DependentUpon>
    </Compile>
    <Compile Include="Program.cs" />
    <Compile Include="Properties\AssemblyInfo.cs" />
    <EmbeddedResource Include="MainForm.resx">
      <DependentUpon>MainForm.cs</DependentUpon>
    </EmbeddedResource>
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\VictorLapin.Binding\VictorLapin.Binding.csproj">
      <Project>{4056C4CF-AB24-4A78-9B4B-9E083A83FA6B}</Project>
      <Name>VictorLapin.Binding</Name>
    </ProjectReference>
  </ItemGroup>
</Project>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
Russian Federation Russian Federation
Has almost 10-years experience of programming on Delphi. Recently started to use Microsoft .NET Framework and C# language for daily job. Likes to develop convenient and user-friendly GUIs.

Comments and Discussions