Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
M

Member 14124661

@Member 14124661
About
Posts
6
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • where to include new class in c# , windows forms, visual studio
    M Member 14124661

    Hi, I am working on some examples of my own and now looking to include a new class for my Banking transactions. Seems like I am doing something in the wrong place etc. I typed in the new code ahead of the standard code created by Visual Studio (17) (I didn't add an item). The information I wanted to create appears in the right hand window CLASS VIEW but I get the errors.

    using System.Windows.Forms;
    public class transactiondata
    {
    public DateTime transDT;
    public string transtext;
    public double transRECD;
    public double transPAID;
    public string transFlag;
    }
    //parameterised Constructor
    public transactiondata(DateTime transDT, string transtext, double transRECD, double transPAID, string transFlag)
    {
    this.transDT = transDT;
    this.transtext = transtext;
    this.transRECD = transRECD;
    this.transPAID = transPAID;
    this.transFlag = transFlag;
    return;
    }
    namespace Santander01
    {
    public partial class Form1 : Form
    {
    public Form1()

    CLASS VIEW shows the class and items above THE ERROR 1>------ Build started: Project: Santander01, Configuration: Debug Any CPU ------ 1>C:\Users\HOME\Documents\Visual Studio 2017\Projects\Santander01\Santander01\Form1.cs(19,8,19,23): error CS0116: A namespace cannot directly contain members such as fields or methods 1>C:\Users\HOME\Documents\Visual Studio 2017\Projects\Santander01\Santander01\For Any help appreciated

    Managed C++/CLI csharp help visual-studio winforms debugging

  • How to format DATETIME
    M Member 14124661

    Many thanks. Very mixed background Wrote first programs in 60's (machine code, user code, Fortran, Algol & many more) Moved into IT sales / management Have developed Forex applications in MT4 which is sort of C based Started with this C++ / CLi on Saturday - so sort of making progress I've fought shy of 'understanding' the ins / outs of C Now retired and need to keep brain cells stimulated ! Thanks for support & comments and will read around

    Managed C++/CLI c++ csharp visual-studio help tutorial

  • How to format DATETIME
    M Member 14124661

    Many , many thanks - your swift responses appreciated enormously Works fine

    Managed C++/CLI c++ csharp visual-studio help tutorial

  • How to format DATETIME
    M Member 14124661

    Thanks again, Apologies - but really struggling with this one

    MessageBox::Show(dateTimePicker2->ToString());
    MessageBox::Show(dateTimePicker2->ToString(), "MMMM dd, yyyy - dddd");

    Both lines of code show same results -

    System.Windows.Forms.DateTimePicker, Value: 22/01/2019 14:26:18

    whereas I'd just like to see January 22, 2019 and in this case no time

    Managed C++/CLI c++ csharp visual-studio help tutorial

  • How to format DATETIME
    M Member 14124661

    Hi & many thanks for your response....however I added the following:-

    dateTimePicker2->Value = DateTime::Now.AddDays(1);
    MessageBox::Show(dateTimePicker2.ToString());
    myTB2->Text = myText;
    

    and failed to complie with the following error - is this what you meant. When I follow your link it refers to C# whereas I am working with C##.

    Severity Code Description Project File Line Suppression State
    Error C2228 left of '.ToString' must have class/struct/union Project1 c:\users\home\documents\visual studio 2017\projects\project1\project1\myfirstform.h 335
    Error (active) E0153 expression must have class type Project1 C:\Users\HOME\Documents\Visual Studio 2017\Projects\Project1\Project1\MyFirstForm.h 336

    Managed C++/CLI c++ csharp visual-studio help tutorial

  • How to format DATETIME
    M Member 14124661

    I am trying to build some simple examples as part of my learning process. I have created a form which includes the dateTimePicker and tried several combinations which have failed. The output initially displays time as HH:MM:00 and only dis[plays correct time when I include ...AddHours(0)... I'd like to format - say

    "MMMM dd, yyyy - dddd"

    My standard output is

    20/02/2019 00:00:00

    private: System::Void button3_Click(System::Object^ sender, System::EventArgs^ e) {
    String ^myText = "1&2-END";
    dateTimePicker2->CustomFormat = "MMMM dd, yyyy - dddd";
    dateTimePicker2->Value = DateTime::Now.AddDays(+30).Date;//dateTimePicker2->Value = DateTime::Today;
    myText = myText + "\r\n" + dateTimePicker2->Value;
    dateTimePicker2->Value = DateTime::Now.AddDays(+30).AddHours(0);//dateTimePicker2->Value = DateTime::Today;
    myText = myText + "\r\n" + dateTimePicker2->Value;
    //myText = myText->Format('YYYY-MM-DD');
    myText= myText + "\r\n" + "& 3 -END";
    //dateTimePicker2.DateTimePickerFormat -> "MMMM dd, yyyy - dddd";
    //dateTimePicker2.DateTimePickerFormat.Custom;;
    myTB2->Text = myText;
    }

    I am using Visual Studio 2017, C++/CLi, W10 Professional Guess I am missing some declaration - I have in .cpp

    #include "MyFirstForm.h"
    #include
    #include
    #include

    //#include _
    using namespace System;
    using namespace System::Windows::Forms;
    using namespace System::IO;
    [STAThreadAttribute]_

    Any help appreciated. Looks like great way to develop FORM & C++ based programs

    Managed C++/CLI c++ csharp visual-studio help tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups