Commits

Darius Damalakas committed 47a6a08

Fixing issue with combo box width

Comments (0)

Files changed (2)

SourceGrid/DevAge.Windows.Forms/Drawing/VisualElements/DropDownButtonThemed.cs

         protected override SizeF OnMeasureContent(MeasureHelper measure, SizeF maxSize)
         {
             if (Application.RenderWithVisualStyles && VisualStyleRenderer.IsElementDefined(GetBackgroundElement()))
-                return GetRenderer(GetBackgroundElement()).GetPartSize(measure.Graphics, ThemeSizeType.True);
+            {
+                var size = GetRenderer(GetBackgroundElement()).GetPartSize(measure.Graphics, ThemeSizeType.True);
+                // in Win-7 machines size is returned as 7
+                // Increase it to 16, so it matches the standard drop-down width
+                if (size.Width < 16)
+                	size.Width = 16;
+                return size;
+            }
             else
                 return mStandardButton.Measure(measure, Size.Empty, maxSize);
         }

SourceGrid_All.sln

 
 Microsoft Visual Studio Solution File, Format Version 11.00
 # Visual Studio 2010
+# SharpDevelop 4.2.0.8649-Beta 2
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SourceGrid", "SourceGrid\SourceGrid.csproj", "{2A5A1657-DBA8-4117-8E2A-9F1236ACE9E2}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DevAge.TestApp", "DevAge.TestApp\DevAge.TestApp.csproj", "{37864E0C-D32E-40A1-B6A8-5B84741681EF}"
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Any CPU = Debug|Any CPU
 		Release|Any CPU = Release|Any CPU
+		Debug|x86 = Debug|x86
+		Release|x86 = Release|x86
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
 		{2A5A1657-DBA8-4117-8E2A-9F1236ACE9E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{257E9149-DA1D-4770-96FF-CB64B045044C}.Debug|Any CPU.Build.0 = Debug|x86
 		{257E9149-DA1D-4770-96FF-CB64B045044C}.Release|Any CPU.ActiveCfg = Release|x86
 		{257E9149-DA1D-4770-96FF-CB64B045044C}.Release|Any CPU.Build.0 = Release|x86
+		{257E9149-DA1D-4770-96FF-CB64B045044C}.Debug|x86.Build.0 = Debug|x86
+		{257E9149-DA1D-4770-96FF-CB64B045044C}.Debug|x86.ActiveCfg = Debug|x86
+		{257E9149-DA1D-4770-96FF-CB64B045044C}.Release|x86.Build.0 = Release|x86
+		{257E9149-DA1D-4770-96FF-CB64B045044C}.Release|x86.ActiveCfg = Release|x86
+		{6DD0E786-111A-4670-BF33-9F2164285F82}.Debug|x86.Build.0 = Debug|x86
+		{6DD0E786-111A-4670-BF33-9F2164285F82}.Debug|x86.ActiveCfg = Debug|x86
+		{6DD0E786-111A-4670-BF33-9F2164285F82}.Release|x86.Build.0 = Release|x86
+		{6DD0E786-111A-4670-BF33-9F2164285F82}.Release|x86.ActiveCfg = Release|x86
+		{C2B31911-9D3A-47D5-8845-2666B8515EE8}.Debug|x86.Build.0 = Debug|x86
+		{C2B31911-9D3A-47D5-8845-2666B8515EE8}.Debug|x86.ActiveCfg = Debug|x86
+		{C2B31911-9D3A-47D5-8845-2666B8515EE8}.Release|x86.Build.0 = Release|x86
+		{C2B31911-9D3A-47D5-8845-2666B8515EE8}.Release|x86.ActiveCfg = Release|x86
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE