15,885,278 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by akamper (Top 8 by date)
akamper
27-Nov-13 3:27am
View
My project is a Dialog-Designer, like the one in VisualStudio.
The properties of the controls are configurable through a property grid.
Some of these properties are using an UITypeEditor for configuration and in some cases the UITypeEditor is a modal dialog (editorFrm).
The Dialog-Designer should be the owner of this modal dialog. At the moment my problem is that the modal dialog is opened at the wrong position.
akamper
7-Mar-12 10:00am
View
Thank you. I already knew the c++ - code snipped. I thought there is a way to do the same or easier in c#.
I'm trying both, parsing the registry and convert the code ;)
Thanks again
akamper
6-Feb-12 3:11am
View
So here the code snippet:
<pre lang="c#">
[Designer(typeof(TGraphDesigner))]
[ToolboxBitmap(typeof(TGraph))]
public class TGraph : TDiagramControl // UserControl
{
public TGraph()
: base()
{
//Init....
}
protected override void OnPaint(PaintEventArgs e)
{
...
}
}
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]
public class TGraphDesigner : System.Windows.Forms.Design.ControlDesigner
{
private DesignerActionListCollection actionLists;
// Use pull model to populate smart tag menu.
public override DesignerActionListCollection ActionLists
{
get
{
if (null == actionLists)
{
actionLists = new DesignerActionListCollection();
actionLists.Add(new TGraphActionList(this.Component));
}
return actionLists;
}
}
}
public class TGraphActionList : DesignerActionList
{
private TGraph customControl;
private DesignerActionUIService designerActionUISvc = null;
//The constructor associates the control with the smart tag list.
public TGraphActionList(IComponent component)
: base(component)
{
this.customControl = component as TGraph;
// Cache a reference to DesignerActionUIService, so the DesigneractionList can be refreshed.
this.designerActionUISvc = GetService(typeof(DesignerActionUIService)) as DesignerActionUIService;
}
// Helper method to retrieve control properties. Use of GetProperties enables undo and menu updates to work properly.
private PropertyDescriptor GetPropertyByName(String propName)
{
PropertyDescriptor prop;
prop = TypeDescriptor.GetProperties(customControl)[propName];
if (null == prop)
throw new ArgumentException("Matching ColorLabel property not found!", propName);
else
return prop;
}
// Properties that are targets of DesignerActionPropertyItem entries.
public Color BackColor
{
get
{
return customControl.BackColor;
}
set
{
GetPropertyByName("BackColor").SetValue(customControl, value);
}
}
public Color ForeColor
{
get
{
return customControl.ForeColor;
}
set
{
GetPropertyByName("ForeColor").SetValue(customControl, value);
}
}
//Implementation of this abstract method creates smart tag items, associates their targets, and collects into list.
public override DesignerActionItemCollection GetSortedActionItems()
{
DesignerActionItemCollection items = new DesignerActionItemCollection();
//Define static section header entries.
items.Add(new DesignerActionHeaderItem("Appearance"));
items.Add(new DesignerActionPropertyItem("BackColor",
"Back Color", "Appearance",
"Selects the background color."));
items.Add(new DesignerActionPropertyItem("ForeColor",
"Fore Color", "Appearance",
"Selects the foreground color."));
return items;
}
}
</pre>
Nothing happens. So I cannot access designer code while debugging design time...
I hope you can help me and give me a hint, what I missed.
thanks
akamper
3-Feb-12 15:12pm
View
Thanks for your hint, but yes I did.
I will post the code on monday (not near the pc over the weekend).
akamper
19-Jan-11 7:04am
View
My "program" is a grafical designer, where the user can create his own GUI (buttons, textfields, grids.. and connect them to some input/output variables).
I'm therefore hosting the WindowsForms designer provided by the .NET Framework.
So the user should be able to drag the grid out of the Toolbox (of my designer!) and place it on the surface. Then he should be able to add columns/rows via the property grid, put some values in cells and so on. And in this design time environment, I would like that the grid already displays the grid as it would behave in runtime (and not only display the panel frame).
So more or less nearly the full runtime behaviour in design time.
akamper
19-Jan-11 5:12am
View
I have tested the grid a little bit now. Its really great and powerful. Unfortunately there is no design time support implemented, which is a big need for my project (where I am trying to implement a small GUI designer).
I will have to try to add some basic design time functionality to the grid, so that the rows and columns get displayed in design time at least. Hope I can handle that.
akamper
18-Jan-11 8:12am
View
Thanks, not until now. I will have a look at it
akamper
18-Jan-11 8:02am
View
Thank you for your answer. I have already found that, but this is a MFC Control and I need a WinForms Control. Obviously the TableLayoutPanel is far too slow for large Tables (as I have found out (google) that a lot of other people facing similar performance problems, but in none of these discussions I could find a solution for this problem)
Show More