form-control

Change formatting of date upon calling value

天大地大妈咪最大 提交于 2021-01-29 09:15:36
问题 On my frontend, I use an Angular (11) Material Datepicker element to let the user pick a date. The formatting for this is done using the MAT_DATE_LOCALE provider, and it is dd-MM-YYYY , so 23-12-2020 for today. This Datepicker is linked to a FormControl using reactive forms. While I am content with how the date is represented to the user, I'd like to send the date in a YYYY-MM-dd format. It seems the Datepicker is setting the value of the FormControl to a Date object and I don't know if I can

Angular MatFormControl, ControlValueAccessor

岁酱吖の 提交于 2020-05-28 08:38:07
问题 I have a custom component, it's a wrap for mat-select. How can I use it in others component's? I was reading about formControl and controlValueAccessor, but I don't understand alot. my custom.html <mat-select> <mat-option [value]="opt" *ngFor="let op of opt; index as i">{{opt[i]}}</mat-option> </mat-select> <input matInput> my custom.ts import { Component, OnInit, Input } from '@angular/core'; import { MatFormFieldControl } from '@angular/material/form-field'; @Component({ selector: 'cust

Angular MatFormControl, ControlValueAccessor

|▌冷眼眸甩不掉的悲伤 提交于 2020-05-28 08:32:27
问题 I have a custom component, it's a wrap for mat-select. How can I use it in others component's? I was reading about formControl and controlValueAccessor, but I don't understand alot. my custom.html <mat-select> <mat-option [value]="opt" *ngFor="let op of opt; index as i">{{opt[i]}}</mat-option> </mat-select> <input matInput> my custom.ts import { Component, OnInit, Input } from '@angular/core'; import { MatFormFieldControl } from '@angular/material/form-field'; @Component({ selector: 'cust

Prevent window redraw when resizing c# windows forms

眉间皱痕 提交于 2020-01-20 14:21:10
问题 What windows message or event can i listen to in order to stop a window from being redrawing every pixel of it's resize? That is, when a user clicks on the edge of the window and starts to re-size it, i don't want to re-draw the entire contents until he lets go. This is because for some reason it's currently choppy at resizing probably because everything is re-docking and what not. I tried WM_SIZING but that only tells me it's being re-sized, i wish to know the start and end of the sizing so

How do you tell if a Windows Form is open but behind another window?

℡╲_俬逩灬. 提交于 2020-01-02 04:20:26
问题 Calling Form.Visible will return true regardless of whether the form is maximized, minimized, or has a FormWindowState of Normal. What I want to know is how to tell if the form is open but "hidden" behind another application's window. If that's the case, I want to bring it to the front and actually make it visible to the user. I tried the BringToFront() method but it didn't work. I also tried calling the Show() method but if the form is behind another application's window, it remains that way

How to set Checkbox FormControl for Multiple array control

邮差的信 提交于 2019-12-24 17:50:01
问题 I am trying toggle/check according specific permissions with array set id's - to set permissions for users according to their user role. for an example an admin would have permissions to create users, delete, and update. My struggle with the code i've posted below is that it toggles all permissions instead of ones passed into formControl im not sure if im doing right. public userList: Array < User > ; public principalList: Array < Principal > ; public permissionList: Array < PermissionItem >

How to dock a windows form in C#?

谁都会走 提交于 2019-12-22 05:51:32
问题 I just would like to know if it is possible to dock a windows form on top of the user screen? I have been trying to do this by manually setting the position of my form to the coordinates I want. But using this method, however, allows the user to change the position of the form just by dragging it. I want to make the form docked to the upper portion of the screen since this window form will server as a menu for the project I am making. Thanks a lot. :) 回答1: I would consider using the Control