|
Hallo,
I am trying to do the same thing. Did you manage to figure this out?
Thanks
There are 10 types of people in the world, those who understand binary and those who dont.
|
|
|
|
|
Hello smyer,
First you made your own scrolling listbox using this code :
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.ComponentModel;
using System.Runtime.InteropServices;
namespace myscrollList
{
class scrollList : System.Windows.Forms.ListBox
{
[Category("Action")]
//public event ScrollEventHandler Scroll = null;
private const int WM_HSCROLL = 0x114;
private const int WM_VSCROLL = 0x115;
public event ScrollEventHandler OnHorizontalScroll;
public event ScrollEventHandler OnVerticalScroll;
private const int SB_LINEUP = 0;
private const int SB_LINELEFT = 0;
private const int SB_LINEDOWN = 1;
private const int SB_LINERIGHT = 1;
private const int SB_PAGEUP = 2;
private const int SB_PAGELEFT = 2;
private const int SB_PAGEDOWN = 3;
private const int SB_PAGERIGHT = 3;
private const int SB_THUMBPOSITION = 4;
private const int SB_THUMBTRACK = 5;
private const int SB_PAGETOP = 6;
private const int SB_LEFT = 6;
private const int SB_PAGEBOTTOM = 7;
private const int SB_RIGHT = 7;
private const int SB_ENDSCROLL = 8;
private const int SIF_TRACKPOS = 0x10;
private const int SIF_RANGE = 0x1;
private const int SIF_POS = 0x4;
private const int SIF_PAGE = 0x2;
private const int SIF_ALL = SIF_RANGE | SIF_PAGE | SIF_POS | SIF_TRACKPOS;
[DllImport("user32.dll", SetLastError = true)]
private static extern int GetScrollInfo(
IntPtr hWnd, int n, ref ScrollInfoStruct lpScrollInfo);
private struct ScrollInfoStruct
{
public int cbSize;
public int fMask;
public int nMin;
public int nMax;
public int nPage;
public int nPos;
public int nTrackPos;
}
protected override void WndProc(ref System.Windows.Forms.Message msg)
{
if (msg.Msg == WM_HSCROLL)
{
if (OnHorizontalScroll != null)
{
ScrollInfoStruct si = new ScrollInfoStruct();
si.fMask = SIF_ALL;
si.cbSize = Marshal.SizeOf(si);
GetScrollInfo(msg.HWnd, 0, ref si);
if (msg.WParam.ToInt32() == SB_ENDSCROLL)
{
ScrollEventArgs sargs = new ScrollEventArgs(
ScrollEventType.EndScroll,
si.nPos);
OnHorizontalScroll(this, sargs);
}
}
}
if (msg.Msg == WM_VSCROLL)
{
if (OnVerticalScroll != null)
{
ScrollInfoStruct si = new ScrollInfoStruct();
si.fMask = SIF_ALL;
si.cbSize = Marshal.SizeOf(si);
GetScrollInfo(msg.HWnd, 0, ref si);
if (msg.WParam.ToInt32() == SB_ENDSCROLL)
{
ScrollEventArgs sargs = new ScrollEventArgs(
ScrollEventType.EndScroll,
si.nPos);
OnVerticalScroll(this, sargs);
}
}
}
base.WndProc(ref msg);
}
private void InitializeComponent()
{
this.SuspendLayout();
//
// scrolled
//
this.Size = new System.Drawing.Size(120, 95);
this.ResumeLayout(false);
}
}
}
After this .........
Drag your listbox on windows forms and than sync two listbox together using this.......
private void scrollList1_OnVerticalScroll(object sender, ScrollEventArgs e)
{
scrollList2.TopIndex = scrollList1.TopIndex;
}
private void scrollList2_OnVerticalScroll(object sender, ScrollEventArgs e)
{
scrollList1.TopIndex = scrollList2.TopIndex;
}
I hope this will work..........
nav_smec
|
|
|
|
|
Thanks
Will try this
There are 10 types of people in the world, those who understand binary and those who dont.
|
|
|
|
|
Hi There,
I'm having some trouble with CheckedListBoxes in my application. The application is written in C# in .NET 1.1. It's multi-tabbed, and on each tab there is an instance of my user control, which contains 6 combo's and 6 CheckedListBoxes.
The control works fine when you stay on a single tab, however when I switch tab and come back again, all the CheckedListBoxes still have their data, but they lose the CheckedItems collection, so they are all unchecked.
Has anyone come across this problem?
Thanks in advance,
modified 30-May-24 18:02pm.
|
|
|
|
|
Jim,
(I could wait til you get back from lunch.. but I think the code project needs to know as well )
I found the problem, its a known bug in .NET 1.1.
Documented here: http://support.microsoft.com/kb/833033
The problem only occurs when the checked list box is bound to a data table.
It looks like Microsoft's only solution is to maintain a collection of checked items and refill on tab switch (rubbish!). But I guess that is what we're going to have to do...
Rob.
|
|
|
|
|
I think when u change the Tab Button then u Fill the The Combo with DataBase, So u lost urs Current Status/View State
|
|
|
|
|
Thanks to reply,
But my question is not related to database . I only want scroll listbox together at same time. If i scroll first listbox than second listbox automatically scroll together.
Thanks ,
Naveen Jatav
|
|
|
|
|
|
Your question has nothing to do with windows forms. Please don't spam the site.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Regsvr32 only works with COM DLLs. If it can't find DllRegisterServer then it isn't a COM DLL and doesn't need to be registered.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
hi,
how to give links to the items moving in a ticker.
Actualy i am fetching the items from a database and showing it in a label control and using timer control i am schrolling it.
but i want to show like when i move the mouse on the item it will display as a link,if i click this link it will open one windows page and show the details of the item.
nilima
|
|
|
|
|
No control does this, but it's easy enough to write one. Just set up a control that contains the text, and keeps drawing itself scrolling, then capture the click event, work out what's been clicked, and then based on that, open another form.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
i am creating an admin section of Media Schedular Application which shows schedules in schedule controls in detail section and the header contains a ruler bar to show the scale in minutes. this schedular shows records for one month and of all four quarters of screen.
i have two panel controls named pnlHeader (no scroll bars) and pnlDetail (both vertical and horizontal scroll bars). when a user scrolls vertically up and down on pnlDetail, there is no effect on pnlHeader but when user will scroll horizontly on pnlDetail the other panel named pnlHeader will also scroll accordingly.
*************************
SetNewGoal:
while (GoalNotAchieved){}
goto SetNewGoal;
*************************
|
|
|
|
|
I have Created a Procedure , i need to intergrate it with vb6, i know that one. i want to insert these fields into Property table and some of them i want to set them here in the Procedure, help to do that and assigning the value of textbox's in vb6 to the variable in a this Procedure. e.g num_key= txtnumkey. Here is my procedure but i did not finish it because of that part.
Create Procedure prcinserting @Num_key varchar(10),@Extension int,@Cell_ID int,
@Actual_Extent float,@Lis_key varchar(50), @Func_key varchar(8)
,@Active bit,@Add_date datetime,@Add_User_ID int,@Spatial_ADD_Date datetime
,@Rateable bit,Non_Discreet_Valid bit
with recompile
insert into Propery(Num_key,Extension,Cell_ID,Actual_Extent,Lis_key,Func_key,Active,Add_date,Add_User_ID,Spatial_ADD_Date,Rateable,Non_Discreet_Valid,)
values ()
Vuyiswa
|
|
|
|
|
Hi friends,
As per requirement I am supposed to place data grid on windows form which have a Filter creteria..My problem is that I have three columns in a grid and filter functionality have to be provided on the basis of contents in all the three columns..so i have to place three comboboxes below column header(one for each column..so that user can choose value from combobox specific to that column and perform filtering).I m facing a problem with placing Comboboxes at required position..i.e below column header,so ithat it look like that three comboboxes are at first row of grid..Reply Soon..plz
|
|
|
|
|
Hi there,
I'm trying to create a class of combo box that allows users to select from a list of filter otpions. In the class declaration I have the following:
...
public filterTypeComboBox()
: base()
{
DataSource = null;
this.Items.Add("= (equals)");
this.Items.Add("<> (not equal)");
this.Items.Add("<= (less than or equal to)");
this.Items.Add("< (less than)");
...
}
...
When I add an instance of the filter combo it duplicates the list of items. Any ideas how to prevent this, or more importantly why this happens? (As a temporary workaround I have commented out the duplicates in the designer).
Thanks
Paul
|
|
|
|
|
in First line U Call the
this.items.clear()
|
|
|
|
|
Curiouser and curiouser...
that seemed to do the trick, at least partially as the designer code now reads:
...
this.m_FilterTypeComboBox1.Items.AddRange(new object[] {
"= (equals)",
"<> (not equal)",
...
"begins with",
"ends with"});
...
However, this is quite strange, when I run the form the combo box lists exactly 2 set of the list when I scroll down using the thumb, however when I scroll using the arrow it only scrolls through 1 set. ie
The combo box items are:
= (equals)
<> (not equal)
...
begins with
ends with
= (equals)
<> (not equal)
...
begins with
ends with
but when I press the down arrow to cycle through the options it gets to ends with and the next item is back to the top of the list.
I'm stumped!
Thanks,
Paul
|
|
|
|
|
hello friends
but i'm going to design the application ...
i need buttons to put in the toolbar and on buttons to give a fine look for the presentation of my application .
can anybody helps me ???
|
|
|
|
|
google image search is the best way I find to get icons, apart from buying icon libraries
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
but the problem here is that i can't find the same layout
i need all the icons to be similar and harmonious
do u have a free source or a site of ????
|
|
|
|
|
|
Hey Budy,
plz logon to
www.iconbazzar.com
it will give give lot's of amezing icons...
Be A Good S/W Eng... Life is swing with you..Enjoy..
|
|
|
|
|
thanks man
but OoOoOps
the site don't open
|
|
|
|
|
I'm looking for a tool or library (that can be used with C#) that would allow me to index many HTML files and to perform a search on this index. I'm looking for something that could be used on a Windows based application (could be a commercial library (other that dtSearch)).
My application is allowing our customer to visualize our publications, we would like to provide them with an efficent search functionality (similar to the search that can be used with HTML help or other Help viewer). The application is installed locally on their computer.
Any suggestions or ideas?
PL
|
|
|
|