|
Hi all,
can anybody help me out here by providing me a solution.
I want to set a focus to masked TextBox control displayed over a cell in CellBeginEdit event.
MaskedTextbox.focus() is not working here
can anybody help me out ???
|
|
|
|
|
Do it using gridviews findcontrol method.
|
|
|
|
|
I have already tried that but no success
Control[] ctrl = datagridview.Controls.Find("name of textbox", true);
ctrl[0].Focus();
|
|
|
|
|
Try it like this.
MaskTextBox mt=datagridview.row[0].FindControl("nameof textbox")
mt.setFouus().
Hope this works.
|
|
|
|
|
there is no funciton like FindControl for datagridview
and there's no function like setFocus() for maskedtextbox
so r u serious in giving this solution?
|
|
|
|
|
sorry for the late reply. But i just did the same.
t1 = GridView1.Rows(0).FindControl("InstallmentDec")
t1.Text = dt.Rows(0)(12).ToString()
Its working for me.
Here use Foucus function in place of setting text will work fine.
|
|
|
|
|
Hi,
there is a stored procedure in Oracle that has a output parameter of type table of records.
What OracleType to use in C# to retrieve it?
Regards,
Adrian
|
|
|
|
|
|
|
|
In addition to SaMartens answer, if you are using .NET 3.5, you can use XDocument.Parse
|
|
|
|
|
i have created a CSV file with following format
"Test1";"Test2";"Test3"
when i tried to read that csv in Notepad using C#.net i am getiing with following format
"""Test1"";""Test2"";""Test3""" is there any way to resolve this
|
|
|
|
|
Hi,
what do you mean by "read that csv in Notepad using C#"? Maybe you could post the piece of code doing this?
Regards
Sebastian
|
|
|
|
|
Hi, according to the output, i think, the standard seperator in your system should be ',' not ';'.
|
|
|
|
|
If you are looking at the value in the debugger, you will see that sort of thing(though usually with backslashes (\)), but it's just the display format, nothing to worry about.
How did you create file? How are you reading it?
|
|
|
|
|
Hi,
I had window Form application in which some text is entered in TextBox and On a button Click, the text in the textbox should be copied through clipboard and those text has to be pasted on other window which has been opened.
I have copied the text through
if(String.IsEmptyORNull(TextBox1.Text))
string CopiedText = ClipBoard.SetText(TextBox1.Text);
i.e., For example, If I want to paste the copied text in the internet explorer in which http;//www.google.com/ is opened, I have to paste that copied text in the searchbox of google site opened in internet explorer.
I have tried to Find the handle through
IntPtr IEHwnd = FindWindow("IEFrame", Null);
and there after
If(IEHwnd != IntPtr.Zero)
{
MessageBox.Show("Handle Found");
SendMessage(IEHwnd, WM_PASTE,0,0);
}
But This is also doesn't effect?
How to approach?
|
|
|
|
|
Does this[^] article help?
/ravi
|
|
|
|
|
Hello,
I am having an enumerator problem while making a custom panel user control. The control extends the System.Windows.Forms.Panel with properties to allow a user to draw a background gradients and rounded border edges.
I use a bit wise enumerator to control which rounded corners are drawn on the border. This all works fine until i make a public property that is accessible in the visual studio designer. The designer will display the default setting when the control is added to a form, but when you change the value of the property it crashes visual studio.
---
The enum...
public enum RectangleCorners
{
None = 0,
TopLeft = 1, TopRight = 2, BottomLeft = 4, BottomRight = 8,
All = TopLeft | TopRight | BottomLeft | BottomRight
}
---
the implementation...
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
namespace Ez_Backup.UserControls
{
public class Panel : System.Windows.Forms.Panel
{
private RoundedRectangle.RectangleCorners pRoundedBorderCorners;
public RoundedRectangle.RectangleCorners RoundedBorderCorners
{
get
{
return pRoundedBorderCorners;
}
set
{
RoundedBorderCorners = value;
base.Refresh();
}
}
}
}
I believe i possibly may be required to add some type of designer attribute. After an hour of google action I am here.
Please help me.
Thanks
|
|
|
|
|
First thing that jumped right(not left ) into my eyes was the lack of the Flags atributte.
You must use it if you want to create combination(s) of the Enums wich you are doing by using the bitwise or (|) operator.
Something like this:
[Flags]
enum Days
{
None = 0x0,
Sunday = 0x1,
Monday = 0x2,
Tuesday = 0x4,
Wednesday = 0x8,
Thursday = 0x10,
Friday = 0x20,
Saturday = 0x40
}
|
|
|
|
|
Hello Moshu,
I have made the following changes.
[Flags]
public enum RectangleCorners : int
{
None = 0x0,
TopLeft = 0x1, TopRight = 0x2, BottomLeft = 0x4, BottomRight = 0x8,
All = TopLeft | TopRight | BottomLeft | BottomRight
}
This is still causing Visual Studio to crash. =[
|
|
|
|
|
MDL=>Moshu wrote: You must use it if you want to create combination
That is not true.
|
|
|
|
|
true. My Bad or my bad expresion.
But it helps. No need to decode and create a human representaion :
using System;
class FlagsAttributeDemo
{
enum SingleHue : short
{
Black = 0,
Red = 1,
Green = 2,
Blue = 4
};
[FlagsAttribute]
enum MultiHue : short
{
Black = 0,
Red = 1,
Green = 2,
Blue = 4
};
static void Main( )
{
Console.WriteLine(
"This example of the FlagsAttribute attribute \n" +
"generates the following output." );
Console.WriteLine(
"\nAll possible combinations of values of an \n" +
"Enum without FlagsAttribute:\n" );
for( int val = 0; val <= 8; val++ )
Console.WriteLine( "{0,3} - {1}",
val, ( (SingleHue)val ).ToString( ) );
Console.WriteLine(
"\nAll possible combinations of values of an \n" +
"Enum with FlagsAttribute:\n" );
for( int val = 0; val <= 8; val++ )
Console.WriteLine( "{0,3} - {1}",
val, ( (MultiHue)val ).ToString( ) );
}
}
|
|
|
|
|
|
Hello Mark,
So what your saying is, I have to create my own property editor to edit the value within the visual studio designer?
Is there no generic designer for a bitwise enumerator with checkboxs next to each value?
|
|
|
|
|
I don't know if you made a mistake when pasting your code but your setter isn't setting the backing field but attempting to set itself!
It should be:
pRoundedBorderCorners = value;
DaveIf this helped, please vote & accept answer!
Binging is like googling, it just feels dirtier. (Pete O'Hanlon)
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|