|
I sort of have databinding working with a set of Radio buttons in a winforms group box.
I have implemented a class with that extends INotifyPropertyChanged with seperate properties for each radio button (Demo below).
On my form I have grouped the radio buttons into a group box so that only one button can be selected at a time. Then under DataBindings I have used the advanced option to set the "checked" value and the data source update mode to "OnPropertyChanged".
The problem that I am having is that each change in selection requires the user to click twice on the destination radio button to make a selection.
using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
namespace PizzaOrder
{
class OrderData : INotifyPropertyChanged
{
public OrderData()
{
m_largePizza = true;
}
#region INotifyPropertyChanged Members
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged(string propertyName)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
#endregion
private bool m_smallPizza = false;
public bool SmallPizza
{
get { return m_smallPizza; }
set
{
if (m_smallPizza != value)
{
m_smallPizza = value;
OnPropertyChanged("SmallPizza");
}
}
}
private bool m_mediumPizza = false;
public bool MediumPizza
{
get { return m_mediumPizza; }
set
{
if (m_mediumPizza != value)
{
m_mediumPizza = value;
OnPropertyChanged("MediumPizza");
}
}
}
private bool m_largePizza = false;
public bool LargePizza
{
get { return m_largePizza; }
set
{
if (m_largePizza != value)
{
m_largePizza = value;
OnPropertyChanged("LargePizza");
}
}
}
}
}
|
|
|
|
|
Hi,
I have a strainge requirement.
I have a panel which has several sub panel controls.
Now I want a list of sub panes for that I wrote "For each ctrl as Control in pnlMain.Controls" loop which is working fine but it is fetching random control not in proper order.
Is there any was that will give me list of sub controls order by their location i.e. x,y. It should retrived from left to right like the one which is on left and top most should be retrived first after that the one which is right to first one and so on...
Help me out.
Thank you in advanced.
|
|
|
|
|
Erhm, 'For Each' loops do not guarantee to retrieve objects from a collection in 'the correct' order.. However, a 'for' loop does...
<br />
For (int iControlCount = 0; iControlCount < pnlMain.Controls.Count; iControlCount++)<br />
{<br />
Control childControl = pnlMain.Controls[iControlCount];<br />
}<br />
However, since you want to retrieve the controls depening on their location, this loop still doesn't work, because the For loop will retrieve all controls in order they were added to pnlMain...
You should loop through the controls and then compare the left & top properties and sort them accordingly..
|
|
|
|
|
Yes i have wrote a sequantial sort logic for getting them in order.
Thanks.
|
|
|
|
|
Hello
I am having a button
When we place a mouse Pointer on that button then a drop down list appear
When we remove the mouse button then disappear
Please post me the answer as early as possible its urgent
|
|
|
|
|
create the onmouseover() event
|
|
|
|
|
vvsprasad wrote: I am having a button
Wow. A lot of people I know are having boys or girls. You really want to get your story published in a medical journal.
vvsprasad wrote: Please post me the answer as early as possible its urgent
When is it never urgent. And no - I'm not going to.
Finally - have you looked at the name of the forum? Do you really think this is the most appropriate place to post this question?
|
|
|
|
|
This entire thread...priceless
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: This entire thread...priceless
It is good isn't it?
|
|
|
|
|
Pete O'Hanlon wrote: vvsprasad wrote:
I am having a button
Wow. A lot of people I know are having boys or girls.
Best response ever!
|
|
|
|
|
Actually it reminds me of when I was learning Spanish. I was standing in line at a McDonalds and I was practicing with my (then) Spanish girlfriend and I said "Voy a tener un Big Mac" (Lit. I am going to have a big mac) and she burst into a fit of giggles. It seems that I said I was going to give birth to a big mac. What I should have said was "Voy a tomar un Big Mac" (Lit. I am going to take a big mac).
|
|
|
|
|
Colin Angus Mackay wrote: (Lit. I am going to take a big mac).
Is this what leads to :
Colin Angus Mackay wrote: It seems that I said I was going to give birth to a big mac
?
Man - what an image that brings to mind.
|
|
|
|
|
Hello Friend!
I've built a windows application.
now I want to show any gif image while system is busy to save data in data base. after completing save operation the image will be invisible. again it will be visible during saving data.
How can I do this?
Please, help me.
Thanks!!!!!!!!!!
|
|
|
|
|
create a backgroundworker for saving the data.
Before calling the RunWorkerAsync() method show your image.
In the BackGroundWorker_RunWorkerCompleted Method you can hide the image again.
You use the BGW (backGroundWorker) to prevent a freeze of the form
If you use a _RunWorkerCompleted-method (reporting the progress) you can even change the image into another image!
|
|
|
|
|
Hi,
Using SourceGrid, unable to use "CopyPasteSelection" from ContextMenuStyle enum....
I am using SourceGrid to display my records, with editable cell. I have a requirement to copy/paste existing row in new row. But here this grid has been little bit customized for some purpose. We are using another class file to doing this, and this class generates the object of Grid. Now this is the problem here, I am not getting the enum item to set the "ContextMenuStyle".
I can set SelectionMode like this :
this.Selection.SelectionMode = GridSelectionMode.Row;
but unable to set ContextMenuStyle :
this."ContextMenuStyle:NOT ABLE TO FIND THE ENUM IN THE LIST TO SET" = ????
Please someone help, or give some idea to resolve this Issues. I am not sure that this been affected by customization.
Thanks in advance.
Kind Regards: Madhusudan
modified on Tuesday, April 1, 2008 8:05 AM
|
|
|
|
|
i have a splitcontainer on my mdi-parent form,
i want to use the right panel (panel2) as the mdi client area
i tried the following code:
childform.MdiParent = this;
childform.Parent = this.splitContainer1.Panel2;
childform.Show();
I can now select the client window inside the panel and drag it.
but the border of the client window still appears like it is not active.
what am i doing wrong?
|
|
|
|
|
Apparently, the MdiClient control (which contains MDI children) is docked to fill the parent window. What I have done in the past is create a regular Splitter[^] (not a SplitContainer ) and dock it to one side of the main form (left in your case), next to the panel you want to resize. That way you get a resizable panel docked to the side, with the MdiClient control covering the rest of your window.
I hope this helps!
|
|
|
|
|
thanks, but i think you missunderstood my problem, there is no problem with the docking and i can select the child window, drag it it all works.
only the active mdi child window doesnt look like it is active:
this is what i mean with a window being active or not active:
http://www.functionx.com/win32/images/active1.gif
just something with the appearance...
i can't show you a screenshot at the moment (working on a different computer now)
but thanks anyway.
|
|
|
|
|
I think your problem lies in setting the Parent property to be different than MdiParent. I have never verified it, but I assume that when you set the MdiParent property of a form, if that parent is an MDI container, the actual parent of the MDI child is the MdiClient window (see this article[^]) in the parent's client area.
When you change the parent of the MDI child, something probably is not right.
Anyway, if you could show us a screenshot, we could get a better idea of what you want to achieve.
|
|
|
|
|
i am very sorry but i was the one who didn't understand...
i tried your first response
and it works now (and it's a simple solution )
the double buffer in the example program (article) is slowing things down on my pc,
so i didnt use that one (especially when the application is maximised)
thanx
|
|
|
|
|
I am glad I could be of help
The article link was mainly to give you some information on the MdiClient control. The double buffering is not required
Have a nice day!
|
|
|
|
|
Code(C# .Net 2.0):
private System.Windows.Forms.ToolStripButton toolStripButton_Scan =new System.Windows.Forms.ToolStripButton();
this.toolStripButton_Scan.ToolTipText = "New transaction created from scan";
question:
How to change the style of the text "New transaction created from scan".
Thank you!
modified on Monday, March 31, 2008 2:33 AM
|
|
|
|
|
It doesnt have a "Font" property, so AFAIK, the Style can't be changed..
You CAN do the following though...
private void button1_Click(object sender, EventArgs e)<br />
{<br />
toolTip1.BackColor = Color.Black;<br />
toolTip1.ForeColor = Color.Yellow;<br />
toolTip1.SetToolTip(this, "Booya!");<br />
}
|
|
|
|
|
But the tooltip cannot been found in ToolStripItem.
Maybe I can get it by reflection,my purpose is to change the fontsize. how to do it ?
thank u!
|
|
|
|
|
Don't think you can do font size :/
I was doing tool-tips for an inventory in a game I was making, and the best I could do was making a semi-transparent form that appears relative to the mouse X/Y co-ords on Mouse_Over :/
Soz :/
|
|
|
|