Nazgulled
Avatar/Signature-
Posts
120 -
Joined
-
Last visited
Nazgulled's Achievements
Newbie (1/14)
0
Reputation
-
Skinned form with black flicker while resizing! (solution attached)
Nazgulled replied to Nazgulled's topic in Windows Forms
Could you be a little more specific on that? And/or provide a little example/sample? What exactly do you mean by "regions" and how would that avoid using layered windows? -
Skinned form with black flicker while resizing! (solution attached)
Nazgulled replied to Nazgulled's topic in Windows Forms
You may be right... :) But how does that help us/me fix the problem? Whenever I get the chance (dunno when cause I'm full of university work and exams) I'll try a couple of things and post the results but if anyone has any more suggestions... -
Skinned form with black flicker while resizing! (solution attached)
Nazgulled replied to Nazgulled's topic in Windows Forms
@PlausiblyDamp Vista 32bits with ATi card (mobility) @marble_eater Yes, it's supposed to support irregular shapes that's why the transparency key is there... but I don't think the transparency key has anything to do with layered windows... -
Skinned form with black flicker while resizing! (solution attached)
Nazgulled replied to Nazgulled's topic in Windows Forms
Using your code or mine? I think I tried with my version but it was the same, maybe yours will be better if I use it on the OnPaint event? -
Skinned form with black flicker while resizing! (solution attached)
Nazgulled replied to Nazgulled's topic in Windows Forms
I'll try that when I get the chance, question though... Why don't you call "base.OnPaintBackground(e);" at all? Either in the beginning or end of the method? EDIT: Just tried your code and I'm not sure it helped, at least my eye can't notice much of a difference... And it presented a new problem. The example I gave is a perfectly squared form, however, I tried with non-square example and with your code a black background would appear on the transparent parts... -
Hi, I'm trying to create some skinned forms (just the border and caption) with a different approach than you usually see but I'm having some issues with form flickering while I re size the form. I don't know how else to explain the problem, so here's a video I created of the problem: http://screencast.com/t/iDv7mPEi0XY Also, here's a VS2008 test solution with the whole code that repaints the form borders: http://stuff.nazgulled.net/misc/TestForm.zip Hope someone can help me getting rid of the flicker...
-
[C#] IComponentChangeService, ISelectionService & IDesignerHost
Nazgulled replied to Nazgulled's topic in Windows Forms
What does everyone think? -
[C#] IComponentChangeService, ISelectionService & IDesignerHost
Nazgulled replied to Nazgulled's topic in Windows Forms
Well, that's quite hard to do as the code is pretty big and separated in classes, I don't even know where to start showing a sample... However, someone suggested me to override the ISite interface in the User Control code and something like this: [csharp]public partial class PageStrip : UserControl { public override ISite Site { get { return base.Site; } set { base.Site = value; if (base.Site == null) return; Global.ICCS = (IComponentChangeService)GetService(typeof(IComponentChangeService)); Global.ISS = (ISelectionService)GetService(typeof(ISelectionService)); Global.IDH = (IDesignerHost)GetService(typeof(IDesignerHost)); } } }[/csharp] Is working for now... -
@PlausiblyDamp Thanks, but that is called every time you open the form. Meaning if you close the tab with the form and reopen it (or close the solution and reopen), it will be called every time. @marble_eater Thank you so much, it worked, at least seems to be working... I just don't know the different between ControlDesigner and ParentControlDesigner, but I'm using Parent for now. So, my code is now like this: [csharp]private PageStrip pageStrip; public override void Initialize(IComponent component) { base.Initialize(component); // Record instance of the control we are designing pageStrip = (PageStrip)component; // Hook up events Global.ISS.SelectionChanged += new EventHandler(OnSelectionChanged); Global.ICCS.ComponentRemoving += new ComponentEventHandler(OnComponentRemoving); } public override void InitializeNewComponent(IDictionary defaultValues) { base.InitializeNewComponent(defaultValues); // Global.AddNewPageStrip(pageStrip); Global.AddNewPageStrip(pageStrip); }[/csharp] And one thing that I never knew when overriding methods is about the "base.SOMETHING" methods. Look at "base.InitializeNewComponent(defaultValues);" and "base.Initialize(component);". Should my code be above or below these lines? And why? I've always placed the code below those code lines but I'm not sure if this is the right way. If you can provide me more insight on this, I wouldn't mind to know more :)
-
[C#] IComponentChangeService, ISelectionService & IDesignerHost
Nazgulled replied to Nazgulled's topic in Windows Forms
Anyone? -
I'm doing this custom user control, I'm also working with designers and I need to use the Interfaces described in the topic subject. But I have a little situation. If any of those interfaces are not initialized somewhere in the code (ie: IComponentChangeService ICCS = (IComponentChangeService)GetService(typeof(IComponentChangeService))), I get an exception. But, I'm using these interfaces in lots of places in the code and in different classes, one of them doesn't even allow me to use the "GetService" method, it says it is not available in this context. So, I'm looking for a way, to initialize these 3 interfaces just once and be able to use them everywhere I want. But I'm not being successful, how can I accomplish that?
-
Hi there, I'm doing this custom user control but I'm having a little issue. This UC has a ToolStrip added to it and I'm working with control designers which allowed me to create the following: http://stuff.nazgulled.net/images/pagestrip-action-preview.jpg When you click on "Insert New Page", a method will be called which will create a new button that will be added to the ToolStrip and a Panel will also be added to the UC which will be associated with the the ToolStrip button. So, if we had a bunch of "Pages", whenever you click a button, the Panel associated will turn visible while the others not visible. So far so good? Now, what I want... Let's say that this UC is almost coded. I compile to a dll file and then I can use it wherever I want. To use it, I just add the dll file to the project and then, drag the UC (which is called PageStrip by the way) from the ToolBox to a form. Now, there's a functionality that I want to be here... When you drag the UC to the form, there won't be any buttons or panels (let's call it "pages" from now on), you'll have to add them manually (like explained in the paragraph above). What I want is a couple of "pages" to be added automatically when the UC is added to the form. Just the way the TabControl works. When you add a TabControl to a form, you'll have 2 tabs already added. How can I achieve the same thing? How can I call twice the same method that is called on "Insert New Page" one time only, and that is, when the UC is added to the form. I have no clue on how to do that. My first and only try was overriding the OnPaint event of the UC and call the method there, then, I would assigned the "true" value to a variable so this would only be called once. However, this would only work while the project was opened. If I closed the project and reopened it, the variable that controlled if a "page" was already added would be "false", the default value. There must be someway to accomplish this without having to workaround like I did using the OnPaint event. Any hints? I hope this detailed post is enough to explain my problem and not to confuse you.