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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
E

Edwin Brunner

@Edwin Brunner
About
Posts
8
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • convert time and minutes
    E Edwin Brunner

    like that? static void Main(string[] args) { string[] timeArray = new string[] { "8:17", "15:26", "18:32", "0:46", "10:38", "13:56" }; foreach (string str in timeArray) { TimeSpan span = TimeSpan.Parse(str); double dHours = span.TotalHours; Console.Write(dHours.ToString("00.00") + " "); dHours += GetExtraTime(span.Minutes); Console.WriteLine(dHours.ToString("00.00")); } Console.ReadKey(); } private static double GetExtraTime(int iMinutes) { if (iMinutes > 53) return 1.0; if (iMinutes > 37) return 0.75; if (iMinutes > 22) return 0.5; if (iMinutes > 7) return 0.25; return 0; }

    C# help

  • convert time and minutes
    E Edwin Brunner

    I don't understand exactly what your problem is? Do you want to convert hours and minutes to decimal hours, ie. 12:45 would be 12.75? I have a couple of lines, which should work: static void Main(string[] args) { string[] timeArray = new string[] { "8:17", "15:26", "18:32", "0:46", "10:38", "13:56" }; foreach (string str in timeArray) { TimeSpan span = TimeSpan.Parse(str); Console.WriteLine(span.TotalHours.ToString("00.00")); } Console.ReadKey(); } Good luck!

    C# help

  • SDI MainFrame Style
    E Edwin Brunner

    // first, add the Minimize style .. cs.style = WS_OVERLAPPED | WS_SYSMENU | WS_BORDER | WS_MINIMIZEBOX; // .. then disable the Maximize style, DON'T forget the '~' operator! cs.style &= ~WS_MAXIMIZEBOX ; // Disable the Close button, //do it somewhere in OnInitialUpdate of the main view HMENU hSysMenu = ::GetSystemMenu(AfxGetMainWnd()->m_hWnd, FALSE); ::EnableMenuItem (hSysMenu, SC_CLOSE, MF_BYCOMMAND | MF_GRAYED);

    C / C++ / MFC question wpf help

  • Scrollbars ??
    E Edwin Brunner

    Please give us a code fragment, so we might see, what's your problem. In general, scrollbars do their work.

    C / C++ / MFC question

  • Dynamically resize dialog
    E Edwin Brunner

    Why do you try to get a pointer to your own class? Try this code: GetWindowRect(&rc); rc.right -= 100; ScreenToClient(&rc); MoveWindow(&rc);

    C / C++ / MFC help question

  • tab control question
    E Edwin Brunner

    Well, I think you have for each tab a dialog and only one of them at a time is visible. Normally, dialogs have an "OK" and a "Cancel" button. If you only delete them, the functionality still is in the dialog and "Enter" or "Esc" will close your dialog. To avoid this, you should override (implement) the "OnOK" and "OnCancel" functions, but without calling its parent functions. void CMySubDialog1::OnOK() { //CDialog::OnOK(); } void CMySubDialog1::OnCancel() { //CDialog::OnCancel(); } This should solve your problem.

    C / C++ / MFC database question com help

  • Setting Background Color
    E Edwin Brunner

    MSDN says: "Sets the current background color to the specified color. If the background mode is OPAQUE, the system uses the background color to fill the gaps in styled lines, the gaps between hatched lines in brushes, and the background in character cells. The system also uses the background color when converting bitmaps between color and monochrome device contexts." So, if you don't write or draw anything, you won't see the desired color. My suggestion for the 'OnDraw(..)' function: CRect rect; GetClientRect(rect); pDC->FillSolidRect(rect, RGB(255,0,0)); There might be other solutions.

    C / C++ / MFC tutorial question

  • Enlarging dialog window
    E Edwin Brunner

    BEGIN_MESSAGE_MAP(CMyDlg, CDialog) //{{AFX_MSG_MAP(CMyDlg) ... ON_WM_SIZING() //}}AFX_MSG_MAP END_MESSAGE_MAP() void CMyDlg::OnSizing(UINT fwSide, LPRECT pRect) { if (pRect->right - pRect->left > 400) pRect->right = pRect->left + 400; CDialog::OnSizing(fwSide, pRect); // TODO: }

    C / C++ / MFC c++ question
  • Login

  • Don't have an account? Register

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