|
oh please dont be sad Luc, cuz i tried it and it's not working either
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Nope!!
thanx for your help
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hello !
I'm trying to get URL from IE which is currently opened. Is there any way to get it? Is it possible with C# ?
Regards,
|
|
|
|
|
Hello ,
There is only one way I think.Try to hook IE .when ever it will start ...Try to get text from the address bar.
regards ,
nishu
|
|
|
|
|
Hello,
I'm trying to figure out how I could make the same "effect" like in Windows CardSpace (just blocking all screens, change their luminosity and show one WinForm to execute my procedure).
Any ideas?
ps: you can view this "effect" after installing framework 3 and going to Control panel -> Windows CardSpace
-- Everything is possible, even the impossible! ^_^
|
|
|
|
|
That effect is called security sandbox and you should be able to enable it using some windows API. By why would you want to? It's very restrictive towards your application.
WM.
What about weapons of mass-construction?
"You can always try to smash it with a wrench to fix that. It might actually work" - WillemM
|
|
|
|
|
I'm writing a differed tasks framework for an application, intercepting computer shutdown and launching a form to execute planified tasks. ^^
Security sandbox is framework 3 only feature?
-- Everything is possible, even the impossible! ^_^
|
|
|
|
|
I have .NET 1 WinForms dataGrid bound to dataTable.
dataTable has primary key field.
dataTable constraints should be checked during editing.
If user moves out from new row, an error occurs.
RowChanging event does not fire before error.
How to fill field with dynamic default value when new row is added to DataGrid ?
To reproduce:
1. Run code
2. Enter data to first column only
3. Press Down Arrow
Observed error:
---------------------------
Committing the row to the original data store has caused an error.
---------------------------
Value Column 'Column2' does not allow nulls. Do you want to correct this value?
Expected:
No error. Primary key column should be filled.
using System.Windows.Forms;
using System.Data;
static class Program {
static void Main() {
Application.Run(new Frm());
}
}
class Frm: Form {
public Frm() {
DataTable table = new DataTable();
DataColumn[] keys = new DataColumn[1];
DataColumn column1 = new DataColumn();
DataColumn column2 = new DataColumn();
DataGrid grid = new DataGrid();
grid.Dock = DockStyle.Fill;
table.Columns.Add(column1);
table.Columns.Add(column2);
keys[0] = column2;
table.PrimaryKey = keys;
Controls.Add(grid);
table.RowChanging += new DataRowChangeEventHandler(OnRowChanging);
grid.SetDataBinding(table, "");
}
private void OnRowChanging(object sender, DataRowChangeEventArgs e) {
if (e.Action == DataRowAction.Add) {
string pk = e.Row.Table.PrimaryKey[0].ColumnName;
if (e.Row[pk] == null)
e.Row[pk] = new System.Guid();
}
}
}
Andrus
|
|
|
|
|
You can make things simpler for yourself by declaring that column as ROWGUIDCOL in your SQL statement. Even if you use the designer, you can make it automatically generate a new GUID for you in that column. Also you shouldn't allow users to manipulate that GUID column, as mixing automatically generated GUIDs with user values would be a bad idea in my prospective.
Regards
|
|
|
|
|
I used guid only as sample.
I'm using existing PostgreSQL database. There is no guid datatype in Postgres.
I need to generate primary key value and other values in client side.
How to add dynamic default values to new datagrid row ?
Andrus
|
|
|
|
|
Well, another workaround on the client side is to handle the DataGridView.RowsAdded event. In the event handler you can add the value you want to any cell in the new row using e.RowIndex property to get the index of the added row.
Regards
|
|
|
|
|
I need to run my C# application in Linux/Mac also. Currently MONO implements DataGrid only in usable level.
So I cannot use DataGridView.
DataGrid does not have RowsAdded event.
So I'm looking for other solution.
I'm thinking about subclassing DataRow() and adding custom code to its NewRow() event. I'm not sure will this work.
Where to find sample which adds dynamic value to new row in DataGrid ?
Andrus.
Andrus
|
|
|
|
|
Well, thing are getting a bit complicated now, aren't they?!
I don't know a place for samples specific to your issue, and I haven't worked with PostgreSQL before, but doesn't it followw the SQL/2003 specifications? I mean dont you have the DEFAULT keyword available in your CREATE TABL E statement?
Your idea is fine, and should work, yet I got two more ideas:
1- When you add the new rows, you do that by clicking a button -for example-, right? In that event, add your default value in the last row of your DataGrid.
2- Handle the DataGrid.Validating event. I think it fires before the error occurs.
Regards
|
|
|
|
|
Hi
In my form i have combobox with value of red,green,yellow... If i move mouse over red my form background color has to change into red, if i move mouse over green my form background color has to change into green..etc..
If anybody know answer pls reply..
|
|
|
|
|
Hi,
My question is very simple. I'm working on ftp client. Its function is clear, just connecting to the ftp server, send a ftp command and receieve a response from the server. Both the result of sending commands and receiving the response are shownn in the richTextBox. What i aimed to do is to make the text color of the sending command is deffirnt from the received response (in richTextBox)
For example,
command: help ===> appearse in the richTextBox as help(in blue color)
response:
ABOR
ACCT
ALLO
APPE
CDUP
CWD
DELE
HELP
LIST
MDTM
MKD
MODE
NLST
NOOP
PASS
PASV
PORT
PWD
===> appearse in the richTextBox in Red color
I tried this code for coloring, but it is coloring the whole text in the richTextBox
the code is
private void sendBtn_Click(object sender, EventArgs e)
{
String[] array = new String[3];
array[0] = bodyTxt.Text;
array[1] = cmndTxt.Text;
bodyTxt.Text = "";
richTextBox.AppendText(array[1] + "\r\n");
// Coloring
richTextBox.SelectionStart = 0;
richTextBox.SelectionLength = cmndTxt.Text.Length;
richTextBox.ForeColor = Color.DarkRed;
writer.WriteLine(cmndTxt.Text);
writer.Flush();
ReadResponse(); //read response from the server
bodyTxt.AppendText(array[0] + "\r\n");
}
for clearification:- cmndTxt.Text is the command the i want to send to the ftp server.
richTextBox is the textBox that recieves the response-from the server-
and the command -from the user.
what should be the modifications for my code?.
Many thanks in advance
|
|
|
|
|
|
Dear Kishore,
Thanks for your post. However,
I had no experience on RTF. Understanding RTF should take much time from me. Also, I didn't found sufficient examples of RTF. All what i need is how to make different colors in one richTextBox. I know that :-
richTextBox.SelectionStart = x; //For starting selection a text in the richTextBox at point x
richTextBox.SelectionLength= y; // For defining the length of the selection
richTextBox.ForeColor = z; // For defining the Color of the text
the complete Coloring code for my project is shown in my 1st post.
Just I need to know what was my error in coding.
thx in advance
|
|
|
|
|
hello, i need a solution for getting only 50 files from a directory.
i have a timer, the elapsedtime time is set to less then a second.on every timer tick i need to get 50 files from directory.
something like this.
getfiles(@"C:/data");
but only 50 files at a time;
is there any way of doing it.
// why i need this
acttulay i created the thread for each file in a directory but the perfomance was horrible wehn the no of files was more thena 500. so i want to do it for every 50 files per timerclik.
hope to get better response.
|
|
|
|
|
hi
i have a asp.net website and i want to send mail from my site (in iis from my computer) to my mail(for example outlook),but how to configure my email seeting in my iis on my computer ?
if possible guide me for configure my outlook for receive and show mails.
thanks.
|
|
|
|
|
Control Panel>Performance and Maintainance>Administrative Tools>Internet Information Services>Default SMTP Virtual Server>Properties>Access>Relay:
All except the list bellow
this should grant the service even to those in your network.
Internet Information Services
Please vote for me
All generalizations are wrong, including this one!
(\ /)
(O.o)
(><)
|
|
|
|
|
Hi there,
I have to drag and drop [toolbar]toolstrip from my toolstrip container onto the form. How can this be made using coding in c# 2005.
|
|
|
|
|
Hi,
How or is it possible to declare a class inheritet from System.ComponentModel.Component as abstract and still be able to use the VS.designer??
/besinci
|
|
|
|
|
Abstract classes can't be instantiated. How do you think you would put an instance of your class in the designer?
Short answer: No.
Regards
|
|
|
|
|
The problem is..
-When inherited from the base class that is defined as abstract; The designer wants to call the default contructor of the base class (there is no problem using the inherited class in the designer).. but it can't as you also mentioned..
-My question was about some how to awoid the designer to call the deafult contructor of the base class..
Regards, /Besinci
|
|
|
|
|
If I understood you right, you want to inherit a class from Component, make it abstract, then inherit more from this class. Right?
Component => Base abstract class => Inherited class
ans when you put the inherited component in the designer, you are getting an error because of the abstract class.
Well, instead of making your class as abstract, you can declare the constructor as protected. This way your base class won't be instantiated, yet any inherited class can call that constructor in the designer.
I hope I got you right this time.
Regards
|
|
|
|