VB.Net DateTimePicker how to stop navigation button from setting a default date - vb.net

I have added a DateTimePicker to my windows forms vb app. Its sets the date when left or right navigation button is clicked. I want to the box to be populated only when an date is clicked. Currently when the navigation button is clicked a date gets set in the box.I looked around in stackoverflow and google but not finding a solution to this specific problem

Figured out the my mistake. I needed to handle the 'DateSelected' event and not the 'DateChanged' event. DateChanged events are getting fired as part for the month changes when clicked on the left/right navigator button and also when the year changes.

Related

VB.Net: Prevent DateTimePicker control to default to First day of the month

For the VB.Net DateTimePicker control, I need to prevent it defaulting to a value(First day of the month) when the Calendar Icon is clicked.
The ValueChanged event does not help in this case as it gets called even if the calendar icon is clicked.
So when the Calendar icon (as highlighted in the image) is clicked, we should see a calendar from which user can make the selection and then the date should be set to the control.

Reset datepicker view using dl-date-time-picker in angular 8

I have a datetimepicker component in a bootstrap modal. I'm using Angular 8 and have used Dalelotts dl-date-time-picker component.
I need to reset the view of date picker whenever user closes the modal i.e. if user selects date but not time and closes the modal, when reopens the modal datetime picker should display from date selection view. But in my case it is showing from where I left off. I tried setting the startView of this datetimepicker component to 'day' on modal close button callback event but did not fix my problem. Any idea to fix this?
I am using something like:
<dl-date-time-picker [(startView)]="startView" [(ngModel)]="enteredDate (change)="dateSelected($event)" [selectFilter]="datePickerFilter"> </dl-date-time-picker>
This is my sample working example:
https://stackblitz.com/edit/dalelotts-angular-date-time-picker?file=src%2Fapp%2Fapp.component.html
You can create an event of type (Click) in the button "Ok" and trigger an method that restart the input to an specific date or set to a empty string

tabindex not being set when textbox has focus

I have a textbox that when focused it calls an ajax request and populates a list for the user to choose from. Basically just recreated the dropdown using a textbox instead of a select.
The problem is that if I click on the textbox the browser does not recognize the tabindex of the input. Instead it resets its self and starts back at 0. If I tab to the next element tabs work fine, only when I click in the input field to give it focus does it start acting up.
I did notice last night if I put an alert in the page on the focus event that it seems to work. Guessing because the browser focuses on the elememt after I click the ok button.
has anyone heard of this before?
found what was causing the problem. I was calling .blur() on keydown and code was 9 or 13 (Tab/Enter). Not sure why this would give me the problem I was having. I would have just thought the blur event would have executed twice. However I suppose that I was forcing blur on keydown and the current tabindex was not being set. If this is the case then If I needed to I should beable to call blur() onkeyup event.

MS Access VBA to set current selection/record to null on a continuous form

I have a form with a subform that is a continuous form. I have a tab control that displays information related to the record selected in the continuous form; the tab control displays as soon as a record is selected/clicked. That all is grand.
However, after the user updates information in the tab control and clicks a button, I want to hide the tab control until a record is actually clicked on the continuous form.
What is currently happening is that the first record in the continuous subform is selected and I'd like for no record to be selected.
Is there a way to set the current record/selection of a continuous form to nothing or null? I've tried setting the bookmark on the continuous form to null in the button click event using Parent.SubApptList.Form.Bookmark = Null and that does not work for me.
Seems like it should be easy, but I can't figure it out.
After the button click event could you set focus to the parent form? Doing this would force the user to click on a record. Maybe I'm not fully understanding exactly what you're trying to do but if all you want is for nothing to have focus after a button event then that's the route I would take. That's assuming you don't having any on focus events for thr main form.

OOB NewForm in Dialog loses focus after a few seconds

Working in SharePoint 2010, with SharePoint Designer 2010, I have a DispForm to which I've added a DVWP that displays a filtered view of another relative list. The DVWP has a 'New' link which opens the NewForm for that list in a modal dialog, using OpenPopUpPage (http://msdn.microsoft.com/en-us/library/ff410825.aspx).
After 5 - 12 seconds, the blinking cursor disappears from the first control and the focus switches to the 'Close' button. If the user was trying to type and happens to hit the Enter key when the focus switches to the 'Close' button, the background is no longer darkened and the 'Cancel' button no longer works. The form is still displayed on the screen, and the user can 'Save' but the modal never goes away until the page is refreshed.
If the user notices that the modal has lost focus and clicked back on the form, everything works as it should and all is well.
Observations:
When the control/modal loses focus, the 'Close' button does not trigger a 'focusin' event. But, $(document.activeElement).attr("value") displayed in the console shows that it's the active element.
Questions:
Why is the modal losing focus?
Does anyone have a Javascript/jQuery workaround to capture the event and set the focus back where it was?
Alternately, what if I lock the form and wait for this focus-change to complete, then unlock it and set the focus on the first field? Ideas?
You may be having a problem if the DispForm is also a dialog and you open the modal with your script. It sounds like you are getting a "layered" effect. My guess is that the script managing the dialog is interfering with the modal. Have you tried turning off the dialiogs for the list?
Just so I get some points on this site, the affliction was the asynchronous refresh of the first modal. It was taking the focus away from the layered modal.
Thanks JB for the answer!
I figured out the problem: the DVWP was using Auto-Refresh with the Async Update. This was running every 15 secs, taking the focus away from the modal, then not returning it to the last control.
So, we turned of the auto-refresh and used the callback from the modal close to trigger a click on the manual refresh button instead.