icon as an image - vb.net

is it possible to use icon file as a image for a button in visual basic?
f.e.
I have 3 buttons that need to have 3 icons when you click the button the icon of the button needs to be the icon of the form is this posible?
btnIcon1 = my.resources.ICO1
btnIcon2 = my.resources.ICO2

The most basic method to do that:
myButton.Image = Me.Icon.ToBitmap
You can also use:
myButton.Image = My.Resources.myIcon.ToBitmap
Both of these methods extract and use the 32x32 icon from the .ico file.

Related

How to open quill image uploader programmatically?

I have a two toolbar in quill.
Quill toolbar
Custom toolbar
I need to put the image tool in the custom toolbar but the problem is that quill is only allowed the addHandler for its own toolbar so I need to open the quill image uploader programmatically when the user clicks on my image.
Is there any way to do it?
Thanks
You can access the Quill toolbar with quill.getModule('toolbar') which will expose the format handlers. This will also work with custom handlers that you've added to the Quill toolbar.
// ... set up quill stuff
// get the quill toolbar
let toolbar = quill.getModule('toolbar')
// call the image handler
toolbar.handlers.image()

Codename one Radio Buttons in a ButtonGroup

#Shai According to the image below got from CleanMordern Project.
how can I style my radio buttons using CSS to look exactly as Shai did his,
and also make actions on each button to show different container when pressed
ButtonGroup barGroup = new ButtonGroup();
RadioButton all = RadioButton.createToggle("All", barGroup);
all.setUIID("SelectBar");
RadioButton featured = RadioButton.createToggle("Featured", barGroup);
featured.setUIID("SelectBar");
RadioButton popular = RadioButton.createToggle("Popular", barGroup);
popular.setUIID("SelectBar");
RadioButton myFavorite = RadioButton.createToggle("My Favorites", barGroup);
myFavorite.setUIID("SelectBar");
Label arrow = new Label(res.getImage("news-tab-down-arrow.png"), "Container");
add(LayeredLayout.encloseIn(
GridLayout.encloseIn(4, all, featured, popular, myFavorite),
FlowLayout.encloseBottom(arrow)
));
You can open the theme file in the designer tool and just copy the styling from there. I implemented this using image backgrounds to keep some pixels free for the arrow on the bottom.
If you look at the theme you will see I just placed a background image that's solid red on top and has a white bottom. Then I have a separate "arrow" image which is animated with the code to the selected button on every click. Everything else is just colors and fonts which is trivial.

How can I disable button press?

I'm trying to make some controls just for their view. For example I need a button which remains unpressed when it's pressed, like it seems on visual basic editor. How can I make this button?
Edit: Here is what I want
Before press:
After press:
Just a few possibilites
WinForms: yourButton.Enabled = false
WPF: yourButton.IsHitTextVisible = false
Make a image of a button and place it in your form

Javafx : Adding contents to the tabs based on chosen file

I am trying to add dynamic contents to tabs. The scenario is when the user clicks on the open file menu, a tab should open displaying the contents of the chosen file. The scene is a border pane which has a pane and tab pane. The contents of respective files are displayed on the pane and should vary according the selected tab.
I appreciate any help to implement this scenario.
TabPane tabPane = new TabPane();
BorderPane mainPane = new BorderPane();
Tab tabB = new Tab();
tabB.setText("Tab B");
tabB.setContent(yourcontent);
tabPane.getTabs().add(tabB);
mainPane.setCenter(tabPane);
primaryStage.setScene(new Scene(mainpane, 400, 300, Color.WHITE););

How to disable logo in Windows 8 metro app live tile?

I am trying to disable the logo in my metro app live tile so that the last line of text in my tile notification will show. The Windows 8 documentation
says that there is a way to disable this logo in the Package.appxmanifest file. However, it does not specify how. I have set the ShortName in my .appxmanifest and I have also set the "Show name" field to "All Logos"; however, the default logo still appears in the bottom left-hand corner of the live tile and obscures the last line of text in my tile notification. Any ideas?
A live tile can have an image, text, or no branding. The default is the app logo, and you override this when you create a live tile update by specifying branding "none", like this:
var templateContent = TileUpdateManager.GetTemplateContent(TileTemplateType.TileWideImage);
var imageElement = (XmlElement) templateContent.GetElementsByTagName("image").Item(0);
imageElement.SetAttribute("src", string.Concat(imagePath, "wide_tile.png"));
var bindingElement = (XmlElement) templateContent.GetElementsByTagName("binding").Item(0);
bindingElement.SetAttribute("branding", "none");
var tile = new TileNotification(templateContent);
TileUpdateManager.CreateTileUpdaterForApplication().Update(tile);
You can't have both the last line of text and a short name. It's either logo/shortname or the the last line of text.
http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/d7ed6580-0528-4a28-a475-731b37f2c89b