How to change "Search" button text in keyboard of SearchBar in Xamarin Forms? - xamarin

I use following code for SearchBar control. When user click on SearchBar, it shows keyboard with "Search" button to search in Keyboard. I want to change name of it.
Here is my current code: Xaml
<SearchBar Text="{Binding SearchText}" Placeholder="Search" />
SS

There is a NuGet package called EntryCustomReturnPlugin. It allows you to change the text on the done button of an Entry.
However I don't think it works with a SearchBar out of the box. You will need to either change your SearchBar into an Entry or write a custom renderer (you can use the source code of the EntryCustomReturnPlugin, the code will be very similar to that).

Related

Maui windows desktop editor appearance

I would like to change the appearance of the Editor control in .Net Maui for Windows Desktop.
If you add a standard Editor to page, for example...
<Editor WidthRequest="300"/>
... a editor control is added which has quite a large amount of empty space between the text and the bottom border line...
This differs from the editors used in the windows desktop o/s itself which are normally quite compact...
Does anyone know if it is possible to change this?
You could try the VerticalTextAlignment="Center" to let the text in the center
<Editor WidthRequest="300" BackgroundColor="Yellow" VerticalTextAlignment="Center" />
Also editor has MinimumHeightRequest and HeightRequest property as #ToolmakerSteve suggest in the comment, you could also try set these values.
There are also many properties for editor. For more info, you could refer to .Net MAUI Editor.
By the way, editor is used to enter and edit multiple lines of text. If you want only one line, you could also use an Entry (.Net Maui Entry)
Hope it works for you.

Open Source dialog directly by clicking custom button

I use CKEDITOR and need to open Source Dialog only, without toolbar and button Source. I want to click button in separate place and show dialog to user. Searching in docs doesnt give any result. Can you suggest me something?

Antd Popover close only when click on a button

Here is sandbox Antd pop over
As you can see in the example when you click out side anywhere, popover automatically closed. I want to disable that thing and close it only through click on a button.
I don't see such options in Popover and Tooltip apis.
Is this possible?
For this you need to remove your onVisibleChange={this.handleVisibleChange} method. You can call this.handleVisibleChange function on button click as given below:
<Popover
content={<a onClick={this.hide}>Close</a>}
title="Title"
trigger="click"
visible={this.state.visible}
>
<Button onClick={this.handleVisibleChange} type="primary">Click me</Button>
</Popover>
I have created a working example on codesandbox.io.

how to set focus at specific position in Entry + xamarin.forms

my entry box has some text already.so can I set cursor focus at start of text?
how? I coudnt find any option for that.if anybody have idea.please suggest.
As you said
In mobile app there wont be focus in load of page.as there will not
keyboard open first.. once user clicks on text than keybopard will get
open.so wherever he click focus will be there?
In mobile app On load focus depend on the requirement. Check out most luxurious android app linkedIn login page, have focus in Username Entry without opening keypad. If you want to avoid using custom renderers in XF than you have to do bit compromise with functionality.
Your second point true- Wherever user clicks focus would be there.
Try doing like this, First update Xamarin.Forms version to 3.1.0.697729 from nuget packages & target framework change to Oreo 8.1.
XAML file
<StackLayout>
<Entry x:Name="txtDummy" HorizontalOptions="Center" VerticalOptions="CenterAndExpand" />
</StackLayout>
your .cs file
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
protected override void OnAppearing()
{
txtDummy.Text = "I am focus";
txtDummy.Focus();
base.OnAppearing();
}
}
Look at output screenshot

Remove right clicking quick access toolbar?

Is there a way to prevent users from right clicking the quick access toolbar? Either by unchecking an option or vba? Either by using I already unchecked Allow Default Shortcut Menus in the options, but it doesn't apply to the quick access toolbar.
Thanks!
So I needed to create a custom ribbon interface using the USysRibbons table. My code is below. All I did was basically clear everything on the ribbon and quick access toolbar and added back a single import from Excel button in the quick access toolbar. It's important that <ribbon startFromScratch="true"> has to be set to true.
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon startFromScratch="true">
<qat>
<sharedControls>
<control idMso="ImportExcel" label="Import from Excel" enabled="true"/>
</sharedControls>
</qat>
</ribbon>
</customUI>

Resources