473,804 Members | 3,185 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Resize without scrollbars

I have a listview control that I want the columns of to remain a
proportional size filling the listview completely. In the listview's
Resize method, I calculate the new sizes and all looks fine.
Sometimes, but not always though, scrollbars appear. The scroll bar
has nowhere to scroll (because the columns fit the listview's size
perfectly), and if you click on the scrollbars, they disappear. Anyone
know what's causing the bars to appear and how to keep the scrollbars
from appearing?

thanks,

john
Jul 24 '06 #1
3 5831
thi
What scrollbar are we talking about? Horizontal or vertical. My guess is the
the column header width is longer then the listview width itself which cause
the horizontal bar to appear and that could result the vertical bar to
appear too.

Can't really tell without seeing what exactly going on.
"John Kraft" <jh*****@barbec ueguy.comwrote in message
news:4l******** *************** *********@4ax.c om...
>I have a listview control that I want the columns of to remain a
proportional size filling the listview completely. In the listview's
Resize method, I calculate the new sizes and all looks fine.
Sometimes, but not always though, scrollbars appear. The scroll bar
has nowhere to scroll (because the columns fit the listview's size
perfectly), and if you click on the scrollbars, they disappear. Anyone
know what's causing the bars to appear and how to keep the scrollbars
from appearing?

thanks,

john

Jul 24 '06 #2
On Tue, 25 Jul 2006 11:27:43 +1200, "thi" <th******@hotma il.com>
wrote:
>What scrollbar are we talking about? Horizontal or vertical. My guess is the
the column header width is longer then the listview width itself which cause
the horizontal bar to appear and that could result the vertical bar to
appear too.

Can't really tell without seeing what exactly going on.
I'm sorry for not being specific enough. It is the horizontal scroll
bar that appears. I have calculated the width of the columns (there
are only 2 columns) like this:

col2Width = listview.Width - col1Width - 4; // 2 pixel border

This seems to work just fine most of the time; however, sometimes the
h scrollbar appears. The only time it is consistently reproducable is
when going from maximized to normalized. The rest of the times it
seems to be random, and clicking on the right scroll button causes it
to disappear. I have tried making my pixel border cushion bigger, but
that doesn't seem to effect it. It's almost as if the calculations
are not being performed each time, or the calculation is somehow
fractional and thereby rounding up. *shrug*

Thanks,

john
Jul 25 '06 #3
thi
Assuming that all the listitems in the listview not exceed the maximum item
count in the visible area of the listview i guess your code look ok. If not
that will cause the vertical scroll bar to appear and of course you will
need to recalculate the second column heard and taking into account that the
new width now should include the vertical scrollbar width. (i think it is 15
pixels)
For example: say i have a listview, width = 500, height = 500, maximum item
display in visible area: 10. Here is my code

//Assuming the columnheader[0] default = 450;
if (listview.items .count 10)
{
//This will force the listview not to show the horizontal bar but
//still keeping vertical bar. 15 is an assumtion of the vertical bar
width.
listview.column header[0].width = 450 - 15;
}
else
{
listview.column header[0].width = 450 ;
}

"John Kraft" <jh*****@barbec ueguy.comwrote in message
news:11******** *************** *********@4ax.c om...
On Tue, 25 Jul 2006 11:27:43 +1200, "thi" <th******@hotma il.com>
wrote:
>>What scrollbar are we talking about? Horizontal or vertical. My guess is
the
the column header width is longer then the listview width itself which
cause
the horizontal bar to appear and that could result the vertical bar to
appear too.

Can't really tell without seeing what exactly going on.
I'm sorry for not being specific enough. It is the horizontal scroll
bar that appears. I have calculated the width of the columns (there
are only 2 columns) like this:

col2Width = listview.Width - col1Width - 4; // 2 pixel border

This seems to work just fine most of the time; however, sometimes the
h scrollbar appears. The only time it is consistently reproducable is
when going from maximized to normalized. The rest of the times it
seems to be random, and clicking on the right scroll button causes it
to disappear. I have tried making my pixel border cushion bigger, but
that doesn't seem to effect it. It's almost as if the calculations
are not being performed each time, or the calculation is somehow
fractional and thereby rounding up. *shrug*

Thanks,

john

Jul 25 '06 #4

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

Similar topics

6
8107
by: Weng kin | last post by:
Hi everyone, I have a problem trying to load an image without the image resizing itself to fit into the window. My simple javascript is as follows: function viewImage(filename) { features = "height=500, width=670, scrollbars=yes, resizable=yes"; photo = window.open(filename, "Preview", features); }
1
1866
by: SAN CAZIANO | last post by:
how can i resize the column of a table and add both the scrollbar to it ?
3
1922
by: alazar_076 | last post by:
Hey, I am using javascript for pop-ups, but I want each pop-up on the page to have its own resize. This is the code that I have: <HEAD> <SCRIPT TYPE="text/javascript"> <!-- function popup(mylink, windowname) {
14
11100
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a window.open function? I would prefer not to create a separate HTML page. So far all I have is the basic var cwin = window.open('images/KJV-THANKS.gif', 'Thanks', 'width=243,height=420,'); cwin.focus();
7
2377
by: windandwaves | last post by:
Hi Folk I use a pop-up window on www.wapitipark.co.nz to view images. On some sites, I saw (a long time ago) a trick where they use Javascript to resize the window to the size of the image. Do you know how to do this? TIA
1
1904
by: Miaaa Mukherjee | last post by:
Hello, I have created three different menu controls. 1)headercontrol.aspx(which contains mainimage heading and midmenu) 2)leftmenu.aspx(which contains the menu thru which we can open diff forms) 3)mfootermenu.aspx(which contains the footermenu) 4)All different forms of .aspx to which i want to open as a window. Pls go thru following code of frame which i created........ <head runat="server"> <title>MIS Main Page</title>
4
36454
by: vbDavidC | last post by:
I have an unbound grid that is on my form (not created programmatically). I stretched the size to what I think is wide enough to accomodate the 6 columns I will be creating. I plan on making the width wide enough so that you don't have to scroll to the right. I want to know if there is a property to resize the width programmatically in case I add or remove columns. thanks
0
9704
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9572
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10562
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10303
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
10070
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7608
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5508
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5639
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2978
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.