How to create a background to keep button on it using resource editor - winapi

I am new to work on resource editor i have created two buttons next and previous to change the page in my own created window using CreateDialog function and resource editor.
Now i want to create a strip which i will put at the bottom of my window and I want to put the two buttons "NEXT" and "PREVIOUS" on that strip and that strip can be coloured (not be white). I want to do so because right now my buttons are on the display of image on my created window and which looks odd so i want my buttons to appear on the colourful strip(just like as you can see for .pdf files preview on preview pane) .
Any ideas how to accomplish it ?? I tried to use "COUSTOM CONTROL" option from the toolbox and wanted to colour it and wanted to put button on it but when i run the programme i found that before i had an image display at preview pane but now it is not working(i mean on putting the "COUSTOM CONTROL" on my IDD_MAINDIALOG the preview of the image don't work any more which was working before but when i put "MFC BUTTON" (just to check if it works or not ??)on my IDD_MAINDIALOG then it works(i mean there is no problem in dispaying the image on my window which had stopped working due to "COUSTOM CONTROL") )
So any ideas how to accomplish this strip creation ??

Maybe it would be easier to put the image inside a picture control rather than putting the buttons inside a strip.

Related

How is this popup message created / programmed?

I recently noticed the following popup message ("6 occurrences replaced") in Qt Creator (3.4.2).
I like its style and want to use it in my own application. But how is it done? Is this a particular widget or what else? Can someone point me in the right direction.
You could create your own window with round corners like that with text in the middle paid show it when you want too make the window so it takes a parameter text and you can add different text each time and show

Messagebox centered to parent Window / Form

I am trying to build my own HTA right now to act as a front end for some of my batch scripts. I would like to use a msgbox (or anything equivalent) that I can use to output any errors, clicking Ok will just get rid of the prompt.
Here is the code I have been using:
x=msgbox("Error text" ,48, "Error: Title")
I would preferably like the following conditions, to be able to use a custom icon, the box to center on X and Y to the parent window/form, and to allow me to define the text in the box and it's title.
If this is not possible then just a messagebox that can be centered on X and Y to the parent window would suffice.
Is there any way of doing this in VBScript?
Or should I look into doing an HTML/CSS version that would popup on the screen?
I don't know the answer to your first question, but whatever the answer is there must be necessarily limits to what a box message box that pops up outside of the HTML can do.
So for customization that includes icon, centering and anything else expressible in HTML/CSS, I think you should do HTML/CSS that pops up on the screen.
You might want to look at jqueryui or bootstrap to get you going faster so you don't have to start from scratch.
https://jqueryui.com/dialog/#modal-message
http://getbootstrap.com/javascript/#modals
They both use jquery underneath so if you aren't already using it, you'll pick up some more bytes in your initial download.

clearing controls Visual basic Forms

I have a Picture boxes inside a parent label and I want to be able remove them all. I tried MyLbl.controls.clear() and that didn't do anything, I did not get an error, just nothing happened. I tried giving them tags and looping through all controls In the form looking for the tag but it never found them.
Is there a way to do this?
WinForms Label control does not allow adding child controls by default using designer, even if picture boxes appear above the label. Unless you explicitly said MyLbl.Controls.Add MyPicture1, the picture box is actually child of your Form or some other container.
You can check this by going to View > Other Windows > Document Outline in Visual Studio when a form designer is open.
In case picture box is child of a form, you'll have to remove related controls from form's Controls collection.
But to simplify this, you can just add a GroupBox or Panel to your Form, and place PictureBoxes there. Then, you can do MyGrpBox.Controls.Clear().

GTK - Don't highlight buttons on select / hover

I'm trying to write a kiosk GUI in ruby/gtk on ubuntu. I'm pretty fluent in ruby, but new to writing GUIs and not great with linux.
I'm using a touch screen, and am using our own images for buttons, e.g.
button_image = Gtk::Image.new(Gdk::Pixbuff.new "images/button_image.png")
#button = Gtk::Button.new
#button.add(button_image)
#button.set_relief(Gtk::RELIEF_NONE)
My issue is that when the buttons are pressed or remain selected (or hovered over, although this is less relevant with a touch screen), gtk shows fat, square borders around them. Obviously it's applying gtk's prelight / selected / active lighting to the buttons. I've tried changing the button properties in various ways, and also tryied hacking apart my theme, and while I can modify how the highlighting looks, I can't seem to completely get rid of it. Changing the color of the highlight via my theme is easy, but if I remove my setting there's still a default I can't get rid of.
Does anyone know if there's a way to stop it, or possibly make it transparent? Thanks in advance!
Sounds like you want to use exactly your image for the whole button, instead of putting an image inside the normal GtkButton - but still use all the normal behavior of the button.
The easiest way to do this is to just override the drawing. If you are on gtk2, connect to the "expose-event" signal, do your drawing there, and return true so that the default handler doesn't get run. If you are on gtk3, connect to the "draw" signal and do the same.
I tried meddling with the drawing as Federico suggested, but found that the most direct way to address this was instead to use an event box rather than a button. Event boxes accept clicks just like buttons, but don't respond to selecting, hovering, etc. In ruby, the code looks like this:
image = Gtk::Image.new("myfile.png")
event_box = Gtk::EventBox.new.add(image)
event_box.visible_window = false
event_box.signal_connect("button_press_event") do
puts "Clicked."
end
Most of this is exactly like a button; the *visible_window* method, obviously, keeps the event box from being visible under the button image.

Change/modify application icon during execution

I want to change the application icon when a button is pressed, or when the app is in a particular state (updating data for example). But I can't find the way to do it.
For example the Steam icon, that when an update is downloading or uploading data have a line of points added to the normal icon of Steam.
I've searched but can not find the way to go.
For example in the case of the Steam icon, and added these lines, superimposing two PNG, the upper transparent background??
Is it possible to completely change the icon at runtime? You mean we have such a square as an icon and pressing a button that becomes such a circle?

Resources