imagelist images not available in child form .net winform - winforms

I have a dll that contains a form that is being inherited by other forms. The parent form has an imagelist with several images in it and two of these are being used in toolbar buttons. It has been working for a long time but I had to add a toolbar button and an image to go with it.
The new button with the new image displays in the designer correctly in the base form, but in an existing child form, the button doesn't display in the toolbar in the designer (although it shows up at runtime with no image). In the child form, the imagelist is present with all the original images, but the new image that I added to the base form does not appear in it.
I have tried several different icons with the same result. Interestingly when I point the new tb button to one of the images that has always existed, everything is fine in the child. It just won't handle any of the new images (I've tried icons & bitmaps). I would try to delete the toolbar and imagelist and re-create it but unfortunately I don't know where the existing images are located to be able to add them back to the new imagelist.
(VS 2010, VB.NET - but C# answers are most welcome!)

I have the same problem. My parent form have an image list wich I use to present my own control box (min, max, close). All the child forms inherit from this form and everything is ok if I don't change the elements of the list. But when I add an element or change the Image index of the control buttons, this is not reflected in the child forms. Sadly I haven't fixed it yet but what I did is:
Declare the Image list as public in the designer of the parent form
Determine the forms that don't reflect the desired change
Set Manually the desired change by adding the image to the inherited IMageLIst and changing the image index in all and every form with the bug
This is not what I intended to do by designing a parent form, but it works.

Related

Removing Border/Margin/Padding from Form

I created a derived Form class, with the constructor using GridLayout as a parameter.
How do I remove the white border(or the margin/padding) from a form object? I tried updating listItemGapInt in my theme.res but that failed to work.
Here is an example of a form taking up the screen. (I believe the border is coming from my Form, it may be from my GridLayout)
Override both Form and ContentPane UIID's in the theme and make sure they have 0 padding/margin:
Double click theme.res
Select "Theme"
Click Add on the bottom
Type in Form on the top combo box
Select Margin tab and uncheck the Derive flag. Do the same for padding
Repeat this with ContentPane instead of form
Press Save in the designer tool

Codename One: constraints (West, center...) not visible in new GUI Builder

The window where the constraints of the Border Layout should show, is empty? Note: of course my Form is selected before I switched to the Layout panel.
->
You need to select the child component that you want centered not the parent container.
I think this will become more intuitive when we split the tree out of the tabs UI so you can always see it like we could in the old GUI builder. Ideally we should also be able to drag into the tree like we could back then.

Creating new UI controls programmatically in visual c++

I have just started using visual studio c++ (2010) with windows forms, but have cannot for the life of me find out how to create new UI items in response to events. What I would want to happen is click a button, and have a new row, with a couple of text boxes and buttons appear, with onebutton to delete the row if I keep clicking, more rows will appear, named row0, row1 etcv. I looked at this page, (http://msdn.microsoft.com/en-us/library/aa984255(v=vs.71).aspx), about adding controls programmatically, but when I add a new text box inside a click event, the text box is only created inside the scope of the event (as expected!), but I want to be able to create it insde the newRow click event, but access it and . I thought of making a 'row' class, with row.text and row.deleteButton properties, and at each creation of a row, respective events will be created for button clicks and text edits.
Is there anyway to do this, ie a function that can be created that creates new objects by passing the required name?
The trick for this to work is that you need to have declarations outside of the event handler to keep track of the newly added UI components. In the link you've given the added TextBox is locally scoped within the event function, and this will be removed from the heap (i.e. memory) when the event is finished.
So one solution would be to add a list of UI components to your form, and then have the events add to or remove from this list of components. To get this solution working you possibly need to read up on lists of objects (or possibly dictionaries) and how to handle these.
Sorry for a rather general answer, but the question is also very broad... :)

Trigger when application is not active

I have an application(Winform, TAB based MDI application), now we are adding few features. These Features are developed in WPF. A new form contains Element host, which will host this WPF User control. This newly added Form is displayed in every Tab's one corner. When application minimizes/Maximizes events are trigger, through these I am able to show or hide this new form. Also, this new form's Topmost Property is set true.
But when main form is still showing and when another application(like a note pad) is opened, the newly added form displayed over this notepad. The new form supposed to go behind the notepad, but it is always top.
Any suggestion on how to send it back.
Thank you,
Selected answer from
Detect when application becomes active post solved my problem.
I am also capturing
main.Deactivate += new EventHandler(main_Deactivate);
Thank you.

In my Windows Phone app,I want to turn my current page unable in gray and show a textbox in foreground

Like the title said,how may i turn the grid(or page) and the components in it into background gray and unable and show a new component in foreground.
It's a common effect in the web page,but i cannot do that with a xaml.
Please answer in detail better with sample code if you do.Thanks in advance.
Here's an example of using a Popup to display a UserControl when a Page is navigated to. The OnNavigatedTo function creates a popup, binds a Click event to the UserControl, and then shows the UserControl over the entire page. If the correct password is entered, ("password" in the example) the control disappears. You'll need to modify it for your own requirements, but it should definitely get you started.
https://skydrive.live.com/redir.aspx?cid=ef08824b672fb5d8&resid=EF08824B672FB5D8!343
You'll want to use the VisualStateManager and create some animation transitions to switch between the old and new components. I won't paste the code here for brevity, but if you check out:
http://visualstudiomagazine.com/articles/2011/07/22/wcmob_visual-states.aspx
You'll see a simple example of switching between two UI components on a single page within a Windows Phone 7 PhoneApplicationPage. In your scenario, you'd use this paradigm to create 2 animation storyboards, one for showing an overlay control and one for settings the 'disabled' property on the main grid.

Resources