|
Hi all,
i am doing validation for phone number in windows application but i am getting some error , please give me an idea.
Thanks
|
|
|
|
|
Use a regular expression. The choice of regex you use depends entirely on the format of the phone number you want to validate, but there are plenty of samples on t'internet.
|
|
|
|
|
The MaskedTextBox also supports phone numbers (I think)
www.wickedorange.com
www.andrewvos.com
|
|
|
|
|
It does, but it's worth using regex validation as well. You should never trust the input into your methods - but you should explicitly test them as well.
|
|
|
|
|
have HP 6767 (with vista OPerating system) NoteBook and SQL Server 2005 inbuild in opertaing system . but i can not access sql sever2005 so how i can access sql Please help me.
Piyush Vardhan Singh
p_vardhan14@rediffmail.com
http://holyschoolofvaranasi.blogspot.com
http://holytravelsofvaranasi.blogspot.com
|
|
|
|
|
Please don't cross post. You already posted this in the SQL Forum (which would be the best forum for this question as it has nothing to do with Windows Forms)
|
|
|
|
|
Hello, i need help about animated tabpage icon.
i want to make tab page with header icon using animated gif looks like mozilla tabpage icon when loading page. is there possible ??
cause when i try it, gif icon doesn't animate.
I have googling around the web and find nothing.
Any Sugesstion will be appriciated
|
|
|
|
|
Don't know where deployment questions go.
I have a windows forms project and deployment msi project. vs2008.
I can't get the application.exe.config file to overwrite on Vista on an upgrade install. I got my binaries to overinstall by making sure they have a new version in each new upgrade install. Do you know anything about this? It will overwrite the config file on xp.
|
|
|
|
|
How to custom code page settings in reportviewer since there is pagesetup dialaog like print daialog
can naybody suggest me how to custom code the page settings in report viewer.
|
|
|
|
|
Member 4290118 wrote: can naybody suggest me how to custom code the page settings in report viewer.
Well I never worked with ReportViewer but if I had your problem I would start by reading the documentation. I know that seems old fashioned and you new guys don't agree with that approach but I guess the old saying is true: You can't teach an old dog bad practices.
led mike
|
|
|
|
|
Hi there.
I am trying to make a composite user control in VB.net that has a trackbar/slider and a few few buttons to set values on the the slider. The slider itself is a custom user control which is referenced in my project (so is a self contained user control). The buttons work fine, and i can set the value of the slider correctly via the user control. I was unsure about the value changed event on the slider since that is a referenced object. I want the value property of my user control to change when the slider is moved, but I don't know how to link the slider's valuechanged event to this. I hope that i've explained this properly.
many thanks, Peter
modified on Thursday, April 3, 2008 2:36 PM
|
|
|
|
|
You need to implement the INotifyPropertyChanged interface see link below
http://msdn2.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged.aspx
Sk8tZ
|
|
|
|
|
hi,
I have a question which how could i call a control (example show image at formA.PictureBox) on from other form?In VB i can call like formA.image.visible = true...But how can i do in c# window form?
Any tips are welcome
regards
cocoon
|
|
|
|
|
Exactly the same... don't forget to set the modifier of the picturebox to public... This is not a neat way by the way... You can better create a property on FormA
<br />
public bool PictureVisibility<br />
{<br />
get { return image.Visible; }<br />
set { image.Visible = value; }<br />
}<br />
|
|
|
|
|
You have to use delegates to communicate between forms. CP has an article explaining this. Search for it
|
|
|
|
|
cocoonwls wrote: I have a question which how could i call a control (example show image at formA.PictureBox) on from other form?In VB i can call like formA.image.visible = true...But how can i do in c# window form?
Simple answer. Don't. It's a bad design and a really dirty hack.
Consider using a pattern such as the Model View Controller pattern to handle this. Your code will end up being more robust, and won't be so intertwined with variable names.
|
|
|
|
|
hi, Pete O'Hanlon,
First of all, i would like to thanks to those who answer my qustion. I am interesting in "Model View Controller" pattern, could you please give me an example depend on my case and some simple explanitation? Off course, i will do a research on this pattern.
Thanks in advanced
regards
cocoon
|
|
|
|
|
Coccoon - I'm pleased to see you wanting to take a more indepth look. It's hard to break MVC down to a really simple pattern, but this[^] article is a highly in-depth overview of the process.
|
|
|
|
|
How to Bind Controls in GridView in VB.Net or C#.Net (Windows Application)
Can Any One help me to sort out this..
|
|
|
|
|
|
Hi Adams,
Thanks yaa...
I hve gone thru the link which u sent.It's working.But for Binding controls in datagrid is thier any necessity to write this much code.Correct me if im wrong
Regds
Krish Vignesh
|
|
|
|
|
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.
|
|
|
|