473,569 Members | 2,704 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Grid Scroll Bar

Hi

Is there a way to force a vertical scroll bar on the data grid, even if the
data grid has no rows?

Thanks

Regards
Nov 20 '05 #1
11 5179
in vb.nei created a timer control in design time, and its
default properties were interval = 3000, enabled = false

when u click on a button it enables the timer and that
works fine, but on another form when they press
the "okay" button it should set the interval to the ,
user specification, but it remains the same as the
default one set in desing time, it changes if its on the
same form perfectly, but not if that command is called
from another form. (in a midule i made the form
declaration as so "public cmain as new main"
then to change the interval it was this
cmain.timer.int erval = txt.text

thx
Nov 20 '05 #2
No.

OHM
"John" <jo**@nospam.in fovis.co.uk> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Hi

Is there a way to force a vertical scroll bar on the data grid, even if the data grid has no rows?

Thanks

Regards

Nov 20 '05 #3
Hello,

"Andrew" <ve**********@h otmail.com> schrieb:
in vb.nei created a timer control in design time, and its
default properties were interval = 3000, enabled = false

when u click on a button it enables the timer and that
works fine, but on another form when they press
the "okay" button it should set the interval to the ,
user specification, but it remains the same as the
default one set in desing time, it changes if its on the
same form perfectly, but not if that command is called
from another form. (in a midule i made the form
declaration as so "public cmain as new main"
then to change the interval it was this
cmain.timer.int erval = txt.text


I think the problem is that you create a _new_ instance of the form in the
module and change the 'Interval' property of its timer control. You can add
a parameter to your procedure and pass the reference to your instance of the
form:

\\\
Public Module Moo
Public Sub Foo(ByVal Goo As Form1)
Goo.Timer1.Inte rval = 100
End Sub
End Module
///

In the form:

\\\
Moo.Foo(Me)
///

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #4
Yes, but as far as I know you need to do it all yourself. So if you plan on
reusing this sometime you can always just derive from the DataGrid and wire
in the logic yourself. You may need to make a few modifications to the code
below, but this should get you started.

public class MyDataGrid : System.Windows. Forms.DataGrid
{
public MyDataGrid ()
{
this.VertScroll Bar.Visible = true;
this.VertScroll Bar.VisibleChan ged += new
EventHandler(Ve rtScrollBar_Vis ibleChanged);
}

private void VertScrollBar_V isibleChanged(o bject sender, EventArgs e)
{
this.VertScroll Bar.Visible = true;
}

protected override void OnResize(System .EventArgs e)
{
// TODO: Need to take caption height and some other aspects into
consideration.
this.VertScroll Bar.Bounds = new Rectangle(this. ClientRectangle .Width -
this.VertScroll Bar.Width, 0, this.VertScroll Bar.Width,
this.ClientRect angle.Height);
base.OnResize(e );
}
}

--
Tim Wilson
Windows Embedded MVP
"John" <jo**@nospam.in fovis.co.uk> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Hi

Is there a way to force a vertical scroll bar on the data grid, even if the data grid has no rows?

Thanks

Regards

Nov 20 '05 #5
I stand corrected then. Was this tested on Cx or VB.NET ?

Regards - OHM

"Tim Wilson [MVP]" <Ti********@Rog ers.com> wrote in message
news:ef******** ******@TK2MSFTN GP09.phx.gbl...
Yes, but as far as I know you need to do it all yourself. So if you plan on reusing this sometime you can always just derive from the DataGrid and wire in the logic yourself. You may need to make a few modifications to the code below, but this should get you started.

public class MyDataGrid : System.Windows. Forms.DataGrid
{
public MyDataGrid ()
{
this.VertScroll Bar.Visible = true;
this.VertScroll Bar.VisibleChan ged += new
EventHandler(Ve rtScrollBar_Vis ibleChanged);
}

private void VertScrollBar_V isibleChanged(o bject sender, EventArgs e)
{
this.VertScroll Bar.Visible = true;
}

protected override void OnResize(System .EventArgs e)
{
// TODO: Need to take caption height and some other aspects into
consideration.
this.VertScroll Bar.Bounds = new Rectangle(this. ClientRectangle .Width -
this.VertScroll Bar.Width, 0, this.VertScroll Bar.Width,
this.ClientRect angle.Height);
base.OnResize(e );
}
}

--
Tim Wilson
Windows Embedded MVP
"John" <jo**@nospam.in fovis.co.uk> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Hi

Is there a way to force a vertical scroll bar on the data grid, even if

the
data grid has no rows?

Thanks

Regards


Nov 20 '05 #6
This is C#, but shouldn't matter. I fully expect that this would run in a
VB.Net application (if translated, of course). And this could also be
written as a control in C# and then used in a VB.Net app - it's the beauty
of IL code.

--
Tim Wilson
Windows Embedded MVP

"One Handed Man [ OHM ]" <te************ *************** @BTOpenworld.co m>
wrote in message news:OO******** ********@TK2MSF TNGP12.phx.gbl. ..
I stand corrected then. Was this tested on Cx or VB.NET ?

Regards - OHM

"Tim Wilson [MVP]" <Ti********@Rog ers.com> wrote in message
news:ef******** ******@TK2MSFTN GP09.phx.gbl...
Yes, but as far as I know you need to do it all yourself. So if you plan

on
reusing this sometime you can always just derive from the DataGrid and

wire
in the logic yourself. You may need to make a few modifications to the

code
below, but this should get you started.

public class MyDataGrid : System.Windows. Forms.DataGrid
{
public MyDataGrid ()
{
this.VertScroll Bar.Visible = true;
this.VertScroll Bar.VisibleChan ged += new
EventHandler(Ve rtScrollBar_Vis ibleChanged);
}

private void VertScrollBar_V isibleChanged(o bject sender, EventArgs e)
{
this.VertScroll Bar.Visible = true;
}

protected override void OnResize(System .EventArgs e)
{
// TODO: Need to take caption height and some other aspects into
consideration.
this.VertScroll Bar.Bounds = new Rectangle(this. ClientRectangle .Width - this.VertScroll Bar.Width, 0, this.VertScroll Bar.Width,
this.ClientRect angle.Height);
base.OnResize(e );
}
}

--
Tim Wilson
Windows Embedded MVP
"John" <jo**@nospam.in fovis.co.uk> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Hi

Is there a way to force a vertical scroll bar on the data grid, even
if the
data grid has no rows?

Thanks

Regards



Nov 20 '05 #7
This is a vb group and I am getting c# examples. :( as if vb.net wasn't
difficult enough.

Regards
"Tim Wilson [MVP]" <Ti********@Rog ers.com> wrote in message
news:ef******** ******@TK2MSFTN GP09.phx.gbl...
Yes, but as far as I know you need to do it all yourself. So if you plan on reusing this sometime you can always just derive from the DataGrid and wire in the logic yourself. You may need to make a few modifications to the code below, but this should get you started.

public class MyDataGrid : System.Windows. Forms.DataGrid
{
public MyDataGrid ()
{
this.VertScroll Bar.Visible = true;
this.VertScroll Bar.VisibleChan ged += new
EventHandler(Ve rtScrollBar_Vis ibleChanged);
}

private void VertScrollBar_V isibleChanged(o bject sender, EventArgs e)
{
this.VertScroll Bar.Visible = true;
}

protected override void OnResize(System .EventArgs e)
{
// TODO: Need to take caption height and some other aspects into
consideration.
this.VertScroll Bar.Bounds = new Rectangle(this. ClientRectangle .Width -
this.VertScroll Bar.Width, 0, this.VertScroll Bar.Width,
this.ClientRect angle.Height);
base.OnResize(e );
}
}

--
Tim Wilson
Windows Embedded MVP
"John" <jo**@nospam.in fovis.co.uk> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Hi

Is there a way to force a vertical scroll bar on the data grid, even if

the
data grid has no rows?

Thanks

Regards


Nov 20 '05 #8
Yes this example is in C#. But you posted your question to a whole bunch of
newsgroups and I am responding from the
microsoft.publi c.dotnet.framew ork.windowsform s.controls newsgroup. So there
is no language specification here. There are many C# to VB.Net converters
out there. Here is one:
http://www.aspalliance.com/aldotnet/...translate.aspx

--
Tim Wilson
Windows Embedded MVP

"John" <jo**@nospam.in fovis.co.uk> wrote in message
news:Od******** ******@TK2MSFTN GP11.phx.gbl...
This is a vb group and I am getting c# examples. :( as if vb.net wasn't
difficult enough.

Regards
"Tim Wilson [MVP]" <Ti********@Rog ers.com> wrote in message
news:ef******** ******@TK2MSFTN GP09.phx.gbl...
Yes, but as far as I know you need to do it all yourself. So if you plan

on
reusing this sometime you can always just derive from the DataGrid and

wire
in the logic yourself. You may need to make a few modifications to the

code
below, but this should get you started.

public class MyDataGrid : System.Windows. Forms.DataGrid
{
public MyDataGrid ()
{
this.VertScroll Bar.Visible = true;
this.VertScroll Bar.VisibleChan ged += new
EventHandler(Ve rtScrollBar_Vis ibleChanged);
}

private void VertScrollBar_V isibleChanged(o bject sender, EventArgs e)
{
this.VertScroll Bar.Visible = true;
}

protected override void OnResize(System .EventArgs e)
{
// TODO: Need to take caption height and some other aspects into
consideration.
this.VertScroll Bar.Bounds = new Rectangle(this. ClientRectangle .Width - this.VertScroll Bar.Width, 0, this.VertScroll Bar.Width,
this.ClientRect angle.Height);
base.OnResize(e );
}
}

--
Tim Wilson
Windows Embedded MVP
"John" <jo**@nospam.in fovis.co.uk> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
Hi

Is there a way to force a vertical scroll bar on the data grid, even
if the
data grid has no rows?

Thanks

Regards



Nov 20 '05 #9
Impressive. I used the converter and tried out your code. It works very
well.

"Tim Wilson [MVP]" <Ti********@Rog ers.com> wrote in message
news:ON******** ******@TK2MSFTN GP11.phx.gbl...
Yes this example is in C#. But you posted your question to a whole bunch of newsgroups and I am responding from the
microsoft.publi c.dotnet.framew ork.windowsform s.controls newsgroup. So there is no language specification here. There are many C# to VB.Net converters
out there. Here is one:
http://www.aspalliance.com/aldotnet/...translate.aspx

--
Tim Wilson
Windows Embedded MVP

"John" <jo**@nospam.in fovis.co.uk> wrote in message
news:Od******** ******@TK2MSFTN GP11.phx.gbl...
This is a vb group and I am getting c# examples. :( as if vb.net wasn't
difficult enough.

Regards
"Tim Wilson [MVP]" <Ti********@Rog ers.com> wrote in message
news:ef******** ******@TK2MSFTN GP09.phx.gbl...
Yes, but as far as I know you need to do it all yourself. So if you plan
on
reusing this sometime you can always just derive from the DataGrid and

wire
in the logic yourself. You may need to make a few modifications to the

code
below, but this should get you started.

public class MyDataGrid : System.Windows. Forms.DataGrid
{
public MyDataGrid ()
{
this.VertScroll Bar.Visible = true;
this.VertScroll Bar.VisibleChan ged += new
EventHandler(Ve rtScrollBar_Vis ibleChanged);
}

private void VertScrollBar_V isibleChanged(o bject sender, EventArgs
e) {
this.VertScroll Bar.Visible = true;
}

protected override void OnResize(System .EventArgs e)
{
// TODO: Need to take caption height and some other aspects into
consideration.
this.VertScroll Bar.Bounds = new

Rectangle(this. ClientRectangle .Width - this.VertScroll Bar.Width, 0, this.VertScroll Bar.Width,
this.ClientRect angle.Height);
base.OnResize(e );
}
}

--
Tim Wilson
Windows Embedded MVP
"John" <jo**@nospam.in fovis.co.uk> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
> Hi
>
> Is there a way to force a vertical scroll bar on the data grid, even if the
> data grid has no rows?
>
> Thanks
>
> Regards
>
>



Nov 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3274
by: blackhawk | last post by:
I need to build a web page that has to potentially display a large amount of data in two grids on the same page. The HTML file with all of the formatting is about 7MB in size. This is too large and I need to implement some kind of "client side" lazy loading. What I mean is this: I want to display a grid that only shows, say, 20 records....
3
2202
by: pmud | last post by:
Hi, I have a web page (asp.net, code:c#). I havean html table with text boxes. Based on the user input , records are displayed in the data grid below it. Now the datagrid has a large no. of columns. & depending on what the user enters, the data grid can grow very large. So to avoid scrolling the whole page, I just want the data grid to be...
1
2142
by: Joe Dunleavy | last post by:
Hi Guys, Hopefully some one will have come across this issue already. I have a DataGrid inside a Div where a scroll bar displays once a certain height is meet --> <div id="dvSales" style="height: 230px; overflow: auto; width: 100%" runat="server"> The Data Grid has AllowPaging is set to False and the HeaderStyle tag is set for the...
10
1919
by: John Wilson | last post by:
My app produces some long datatables to display in a grid. So I put them in a div so users can scroll. But the grid headers scroll out of view. I would like to stop them doing this. Can I fix them in place at the top of the div? -- John Wilson
6
1979
by: Tom | last post by:
I need to make up a 'grid' of controls at run time. The controls (of which I wrote) I will instantiate, then I need to arrange these in a row/column layout. For example, let's say I instantiate 20 of the controls; then I want to position them in a grid-like display (within a Windows Form) as 5 rows of 4 controls each. If the 'grid' doesn't...
1
3556
by: Robert G | last post by:
I'm using VB .net 2003. I have a grid where everything is working fine except when after the grid is filled with records (by setting the data source to a data view), both the horizontal and vertical scroll bars just won;t show up, eventhough the record numbers and columns are well exceeded the area. If I minimized and maximized the main...
3
5030
by: EdB | last post by:
How do I capture the position of the vertical scroll bar? I present the grid to a user, they select an item, and I pop up an edit window. When they are done, I need to refresh the grid (editing cell contents of the grid is not an option here). when I refresh the grid, the scroll bar is back at the top. I want it where it was. I can...
0
1031
by: Devesh | last post by:
Hi, I want to display some parameters & their value in Same data grid as shown Parameter | Value | Parameter | Value |Parameter | Value So please suggest me the way to Split grid which will have first row as above & Rest row will contain Param Name & Values. These all parameter & values, i am having in Data set. Another...
2
3844
by: Umeshnath | last post by:
Hi, I have placed a grid view inside Atlas panel. On click of a button event, data is populated in the grid view, I want to add scroll bar instead of increasing the size of grid view. I have written the following code. <div id="Layer1" style="width:350px; height:140px; z-index:1;overflow-y: scroll"> But the problem was scroll bar will...
3
2461
by: gaya3 | last post by:
Hi All, I have painted the dojo grid 1.1 with height of 20em as follows.. # gridName { height:20em; } The input for that grid is about 1000 records.so, number of records exceeds the height of grid and hence the vertical scroll bars got attached. if the number of records going to be less than height of grid...
0
7698
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7924
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8122
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7673
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
1
2113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1213
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
937
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.