Romão Posted March 31, 2015 at 03:03 PM Report Share #580605 Posted March 31, 2015 at 03:03 PM Eu tenho uma MaskedTextBox com a configuração de data pequena e eu queria saber como eu poderia fazer para ao carregar num botão ele acrescentar um ano à data que lá está apresentada. Link to comment Share on other sites More sharing options...
ribeiro55 Posted March 31, 2015 at 03:08 PM Report Share #580609 Posted March 31, 2015 at 03:08 PM Porque não usas um DateTimePicker ? Sérgio Ribeiro "Great coders aren't born. They're compiled and released""Expert coders do not need a keyboard. They just throw magnets at the RAM chips" Link to comment Share on other sites More sharing options...
Romão Posted March 31, 2015 at 03:10 PM Author Report Share #580611 Posted March 31, 2015 at 03:10 PM Porque não usas um DateTimePicker ? Se não se importar podia ser mais especifico é que eu não percebo muito de visual basic. Poderia escrever o código que tenho de usar? Link to comment Share on other sites More sharing options...
williamjda Posted March 31, 2015 at 03:26 PM Report Share #580613 Posted March 31, 2015 at 03:26 PM Amigo , bom dia. DataTimePicker é uma ferramenta do ToolBox de seu Visual Studio. Link to comment Share on other sites More sharing options...
Romão Posted March 31, 2015 at 03:34 PM Author Report Share #580620 Posted March 31, 2015 at 03:34 PM O problema é que tenho de ser eu a escrever a data pois é um programa de guardar informação o que eu queria é ao carregar no botão ele acrescentava um ano e guardava no access pois o que eu tou a fazer é para saber quando os carros têm de ir à inspeção. Link to comment Share on other sites More sharing options...
ribeiro55 Posted March 31, 2015 at 03:49 PM Report Share #580622 Posted March 31, 2015 at 03:49 PM Não invalida. Podes escrever tu a data com um DateTimePicker, não precisas do calendário. A grande diferença é que o DateTimePicker mantém o data type. Para acrescentares depois um ano a um DateTimePicker é tão simples como: DateTimePicker1.Value = DateTimePicker1.Value.AddYears(1) Sérgio Ribeiro "Great coders aren't born. They're compiled and released""Expert coders do not need a keyboard. They just throw magnets at the RAM chips" Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now