Posted 30 June 2026, 10:41 am EST
Hi,
You are seeing this error because C1Dialog utilizes a single string-based Position property instead of explicit X and Y integers.
To avoid rewriting the rest of your application’s logic, we recommend keeping your X and Y properties as integers. You can simply update their Get and Set accessors to parse and update the C1Dialog.Position string behind the scenes.
Here is the updated code:
// Helper method to safely read the string and return an array of [X, Y]
private int[] GetDialogPosition()
{
string pos = PlaceWindow.Position;
// Handle empty or named positions gracefully (defaulting to 0,0)
if (string.IsNullOrWhiteSpace(pos) || !pos.Contains("["))
return new int[] { 0, 0 };
try
{
// Strip the brackets and split by comma: "[10, 20]" -> "10", " 20"
string[] coords = pos.Trim('[', ']').Split(',');
if (coords.Length == 2)
{
int.TryParse(coords[0].Trim(), out int x);
int.TryParse(coords[1].Trim(), out int y);
return new int[] { x, y };
}
}
catch
{
// Fallback safety
}
return new int[] { 0, 0 };
}
public int X
{
get { return GetDialogPosition()[0]; }
set { PlaceWindow.Position = $"[{value},{GetDialogPosition()[1]}]"; }
}
public int Y
{
get { return GetDialogPosition()[1]; }
set { PlaceWindow.Position = $"[{GetDialogPosition()[0]},{value}]"; }
}
Best Regards,
Kartik