473,748 Members | 2,578 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Binding Property "Size" Works But Not "Width" -- Please Explain

Tom
Can someone please explain the non-working aspect of binding to Width?
See code below.

Thanks !!

-- Tom
=============== =============== =============== ======

using System;
using System.Collecti ons.Generic;
using System.Text;
using System.Windows. Forms;

public class FormParent : Form
{
[STAThread]
public static void Main()
{
Application.Ena bleVisualStyles ();
Application.Run (new FormParent());
}
FormParent()
{
Text = "The Parent Form";

Form FormChild = new Form();
FormChild.Text = "The Child Form";
FormChild.Show( );

// The following works!! :)
FormChild.DataB indings.Add("Si ze", this, "Size");

// The following does NOT! :(
//FormChild.DataB indings.Add("Wi dth", this, "Width");
}
}
Dec 22 '07 #1
3 1579
Simple; bindings depend on change-notification for the "observer"
behavior. The simplest form of this is a {property name}Changed event.
There *is* a SizeChanged event, but there *isn't* a WidthChanged
event. The binding will look for a suitable event and attempt to
subscribe if possible (usually via the PropertyDescrip tor). However,
it can't do this for Width as it can't find a suitable notification
mechanism.

Marc
Dec 22 '07 #2
Tom
Thanks Marc --

That hits like a lightnin bolt!!

I'm just now exploring bindings and I tripped on the first obstacle!!

I appreciate your help.

Happy Holidays.

-- Tom

On Sat, 22 Dec 2007 05:53:24 -0800 (PST), Marc Gravell
<ma**********@g mail.comwrote:
>Simple; bindings depend on change-notification for the "observer"
behavior. The simplest form of this is a {property name}Changed event.
There *is* a SizeChanged event, but there *isn't* a WidthChanged
event. The binding will look for a suitable event and attempt to
subscribe if possible (usually via the PropertyDescrip tor). However,
it can't do this for Width as it can't find a suitable notification
mechanism.

Marc
Dec 22 '07 #3
No problem,

Marc
Dec 23 '07 #4

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

Similar topics

8
33909
by: Mario T. Lanza | last post by:
I'm not sure what I'm doing wrong. I have a form that has mnay input fields. Before each input field is a label enclosed in custom LABEL tags. Inside my CSS I have: LABEL { width: 120px; }
15
122142
by: Gérard Talbot | last post by:
Hello all, I'd like to know and understand the difference between, say, <img src="/ImageFilename.png" width="123" height="456" alt=""> and <img src="/ImageFilename.png" style="width: 123px; height: 456px;" alt="">
1
9365
by: John | last post by:
I'm trying to use the DrawText() method to draw some very long string text on the Panel with AutoScroll enabled. However, for some unknown reasons, I could not trigger the ScrollBar to show up. Here is the simplicied section of drawing code: private void panel_Paint(object sender, System.Windows.Forms.PaintEventArgs e) { panel.AutoScroll = true;
3
11029
by: Lasse Edsvik | last post by:
Hello I was wondering if its possible to the "width" and "height" of a text when creating a pic from text. string sometext = "bla bla"; Font font = new Font("Verdana", 18); SolidBrush sb = new SolidBrush(Color.Red);
3
3780
by: Roy Gourgi | last post by:
Hi, How would I set the width of lnSize to 6 in the statement Console.WriteLine("Size of {0} ", lnSize); Furthermore is there a way to combine these 3 statements into 1 Console.WriteLine(); Console.WriteLine();
2
1345
by: Brian Bischof | last post by:
To get my formatting to work with Firefox and IE browsers, I have to be very careful about the layout. So I'm removing all the Style tags that set the Height and Width values (and some of these values make no sense). But then when I go back on look at the HTML later on I see the Style tags have been added back and my formatting is all screwed up again. Arghh!! Can someone tell me how to make ASP.NET stop adding these troublesome Style...
10
5307
by: NH | last post by:
I have a girdview with paging enabled. How can I add a message in the footer to say "Viewing records 1-15 of 45" etc Thanks
20
4316
by: AndyZa | last post by:
Is the following html valid? <p><hr width="50%"></p> Or would the following be more "technically correct"? <p> <hr width="50%"> Do I require the closing </p> tag?
3
5314
by: Phil Endecott | last post by:
Dear Experts, It looks as if the HTML4 spec does not define a meaning for empty height and width attributes in an IMG element. Moz seems to ignore them, while IE7 sets the dimension to 1 pixel (or something like that). I have a vague recollection that "" did have a defined meaning at some point in the past, but maybe I am mis-remembering. Can anyone confirm? I have encountered this in some third-party PHP code that I'm using on
0
8996
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
8832
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
9562
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...
0
9386
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9254
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...
0
8255
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6799
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
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.