Jump to content
Xtreme .Net Talk

chrisliando

Members
  • Posts

    7
  • Joined

  • Last visited

About chrisliando

  • Birthday 12/29/1981

chrisliando's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I use Visual C++ and .Net 2.0. I have 2 listViews, lv1 and lv2. All in Details View. If I use the MouseWheel to scroll / use the listView scrollbar to scroll the content (Horizontally or Vertically) on either lv1 or lv2 then the other will synchronized (scroll at the same time). How to do that since the listView does not have any Scroll related event? I have successfully Scroll both listView but I must use Buttons, button1 for scrollup and button2 for scrolldown and they only scroll vertically like this: [DllImport("user32.dll")] static bool ShowScrollBar(System::IntPtr hWnd, int wBar, bool bShow); [DllImport("user32.dll")] static bool EnableScrollBar(System::IntPtr hWnd, UInt32 wSBflags, UInt32 wArrows); [DllImport("user32.dll")] static IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, UIntPtr wParam, IntPtr lParam); private: static int const SB_VERT = 1; private: static int const ESB_DISABLE_BOTH = 0x3; private: static int const ESB_ENABLE_BOTH = 0x0; private: static int const WM_VSCROLL = 0x115; private: System::Void Results_Load(System::Object^ sender, System::EventArgs^ e) { EnableScrollBar(this->lvSource->Handle, Convert::ToUInt32(SB_VERT), ESB_DISABLE_BOTH); EnableScrollBar(this->lvDestination->Handle, Convert::ToUInt32(SB_VERT), ESB_DISABLE_BOTH); } private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { SendMessage(this->lvSource->Handle, Convert::ToUInt32(WM_VSCROLL), System::UIntPtr(Convert::ToUInt64(ScrollEventType::SmallDecrement)), System::IntPtr(0)); SendMessage(this->lvDestination->Handle, Convert::ToUInt32(WM_VSCROLL), System::UIntPtr(Convert::ToUInt64(ScrollEventType::SmallDecrement)), System::IntPtr(0)); } private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) { SendMessage(this->lvSource->Handle, Convert::ToUInt32(WM_VSCROLL), System::UIntPtr(Convert::ToUInt64(ScrollEventType::SmallIncrement)), System::IntPtr(0)); SendMessage(this->lvDestination->Handle, Convert::ToUInt32(WM_VSCROLL), System::UIntPtr(Convert::ToUInt64(ScrollEventType::SmallIncrement)), System::IntPtr(0)); } Thank you very much.
  2. Yes, I think I have to do like you said, "declaring a member of type NativeWindowsEvent". I guess it will fix the error. But I don't understand how to declare a member of type.. Can you help me, please? This one is not a declaration? event WindowsEventHandler ^NativeWindowsEvent; Thank you very much..
  3. (1) What is Project::Subclass::NativeWindowsEvent and how to use it? I've got codes in old C++ syntax and I want to change it to the new one. // =================================================================== // NativeWindow Subclassing // =================================================================== ref class Subclass : public System::Windows::Forms::NativeWindow { public: delegate void WindowsEventHandler(Object ^sender, Message ^uMsg); event WindowsEventHandler ^NativeWindowsEvent; Subclass(IntPtr pWindowHandle) { this->AssignHandle(pWindowHandle); } void SendWndProc( System::Windows::Forms::Message ^uMsg ) { //super::WndProc(uMsg); } protected: void WndProc( System::Windows::Forms::Message ^uMsg ) { //__super::WndProc(uMsg); if ( Project::Subclass::NativeWindowsEvent != nullptr ) Project::Subclass::NativeWindowsEvent(this, uMsg); } }; When I compiled it, the error message was: Error C3918: usage requires 'Project::Subclass::NativeWindowsEvent' to be a data member see declaration of 'Project::Subclass::NativeWindowsEvent' How to change it to the new C++ syntax? (2) What is "__super" in old C++ syntax converted to new C++ syntax? Thank you very much.
  4. I use like the ones I posted. Thank you I'll try this first..
  5. Hi, I am developing a text comparer application. How to detect if there is an empty line in the textBox? I have tried with the method String::IsNullOrEmpty and detect if the line is equal to "\n" but it still don't work.. How to do that? I am using Visual C++ and .Net 2.0. Thank you very much.
  6. Hi. I am using Visual C# 2005 Express Edition and .Net 2.0. I need to make if I scroll textBox1 then textBox2 will be scrolled too.. I need it VERTICALLY and HORIZONTALLY. How to do that? Thank you very much.
×
×
  • Create New...