|
Hello,
In a window application, i open forms from my main window. When i open a form from an other form, the second is always under the other, how can i do to put it on the top?
Thank you for the answers.
|
|
|
|
|
use method ShowDialog() to display focused form.
|
|
|
|
|
Thank you for the answer but i don't want a modal form
|
|
|
|
|
in my app i use childs, so i also have diff forms in my main form, i simply tell the childs were to stand:
databchild.Show(); // show form3
databchild.Top = 10;
databchild.Left = 10;
databchild.Height = 550;
databchild.Width =560;
grz
|
|
|
|
|
hi,
i want to change the color of rows with wrong info when i load my form,
the info comes from a database, it is checked on error earlier and replaced the value of the cell with "wrong info",
now in my load i check all the cells of my datagrid on "wrong info" values if ther is one i want that entire row to color red.
i have tried it for one column where there is wrong info, the breakpoint shows me that he does the color changing, but nothing has changed in the view.
is it changed back so quickly that i couldnt see it in red? if yes , where woud that code be written? in the defaultview maybe? and how do i sort it then?
this is what i wrote in the load from function:
lastrow = dataGridView1.Rows.GetLastRow(DataGridViewElementStates.Visible);
for (int x = 0; x < lastrow + 1; x++)
{
string fout = dataGridView1.Rows[x].Cells[3].Value.ToString();
if (fout == "wrong info")//check on wrong info
{
dataGridView1.Rows[x].Cells[3].Style.BackColor = Color.Red;// color red
dataGridView1.Rows[x].Cells[3].Value = "error";// change value to error
}
}
thx
|
|
|
|
|
dataGridView1.Rows[x].Cells[3].Style.BackColor = Color.Red;// color red
dataGridView1.Rows[x].DefaultCellStyle.BackColor = System.Drawing.Color.Red
good luck
Where there is a will,there is a way.
|
|
|
|
|
thx, i also found something in the meentime
private void dataGridView1_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e)
{
index = dataGridView1.Rows.GetLastRow(DataGridViewElementStates.Visible);
for (int x = 0; x < index + 1; x++)
{
for (int y = 0; y < colamount; y++)
{
string fout = dataGridView1.Rows[x].Cells[y].Value.ToString();
if (fout == "foute input!")
{
dataGridView1.Rows[x].Cells[y].Style.BackColor = Color.Red;
}
}
}
}
instead of using the load im using addrows, so i dont have to write this when the form loads and when im adding a row
grz
|
|
|
|
|
hi everybody!!
iam using the create user wizard and login control provided in the Login tab of the toolbox in VS2005. iam using them for authentication in my application.
the problem is, i need to know how the password is encrypted and stored in the aspnetdb database when a new user is created. Also i need to know how the Login control authenticates a user, i.e., how does it verify the password entered while authenticating.
i would be grateful to anybody who can help me in this regard as my entire application depends on this. The reason why i want to know this is i need to encrypt a password using the same method and verify it with the encrypted password in the aspnetdb. This would give correct results only if both methods of encrypting are same.
thanks in advance to anybody and everybody who replies to this query. plz help me guys!!!!!!!
Sonu
|
|
|
|
|
Hi Sonu
You need symmetric algorithm for functionality like encrypting password. In symmetric approach single key is used for encrypting strings. You can visit my blog http://aamironline.blogspot.com/2006/08/simple-encryption-and-decryption-with.html[^] where I have created a Cypher class for such purpose.
If you are using login control for authentication then you will have to subscribe to Authenticate event of the control. Following sample code shows you how to do authentication with login authenticate event.
protected void Login_Authenticate(object sender, AuthenticateEventArgs e)
{
if (Login.UserName == "Aamir")
e.Authenticated = true;
else
e.Authenticated = false;
}
|
|
|
|
|
I have a problem in my C# project
I added a User Control in my project & added some items form Toolbox to it.
the items are 2 panel(panel1,panel2). so I add this control to my window application
Now I want,When I drag an item from ToolBox to my control, it locates on panel2.
How can I do this.Please help me.
ThanX in advance
|
|
|
|
|
|
That was good,
if you read carefully the question,
I have two panel ( Panel1 , Panel2) in my Control and i want the item from ToolBox locates on Panel2. How can i do it?
|
|
|
|
|
hi you can overide controlsadded in your usercontrol and destroy the added component and create new instance of the same and add to your panel.
but there is a problem.. as it can add to the controls to panel but you can relocate the cotrol.
The code is below,sorry dont have much time to explore more in to it.Dont know how helpful its to you..
good luck.
bool _tmpOnRelocate = false;
protected override void OnControlAdded(ControlEventArgs e)
{
try
{
DesHost = this.Container as IDesignerHost;
if (DesHost != null && e.Control.Parent == this)
{
if (_tmpOnRelocate) return;
this.SuspendLayout();
Control _Holder = e.Control;
_Holder.Location = new Point(0, 0);
_tmpOnRelocate = true;
IComponent _tmpComp = DesHost.CreateComponent(_Holder.GetType());
DesHost.DestroyComponent(e.Control as Component);
((Control)_tmpComp).Parent = this.panel2;
this.panel2.Controls.Add(_tmpComp as Control);
this.ResumeLayout();
_tmpOnRelocate = false;
}
else
{
base.OnControlAdded(e);
}
}
catch (Exception ee)
{
MessageBox.Show(ee.Message);
}
//base.OnControlAdded(e);
}
Where there is a will,there is a way.
|
|
|
|
|
Thanks,
But when i drag a control to my User Control,
'Child' is not a child control of this parent error occurred
|
|
|
|
|
Hi
i am using a folder that contains png file
i want to make this folder relative to my application.
How can we do this
btn_select_folder.BackgroundImage=System.Drawing.Image.FromFile(@"E:\GUI SkeltonButton\GUI Skelton\png1\002.png");
where should i place the png1 folder that need not give the full path in c# application
|
|
|
|
|
Ur folder png1 set in same path where is ur EXE file and call path like this:
<br />
btn_select_folder.BackgroundImage=System.Drawing.Image.FromFile(Application.StartupPath + @"\png1\002.png");
|
|
|
|
|
I ought to have the live mail look in the windows forms, yet im stuck on the part where the mail list is displayed on which we click to see its details ( The Middle Panel ). We can also sort our mail in that panel(jz for clarifying) ... can u plz tell me how to give that look in Windows Forms....
Thanks in advance ...
Abdus Samad
Bye
|
|
|
|
|
Hi
i need regular expression for time (24 hours) like 23:10:18
can anybody provide me.
regards
sAqIb
|
|
|
|
|
I have this regular expression:
^(20|21|22|23|[01]\d|\d)(([:][0-5]\d){1,2})$
its workign for 24 hours time but works only till minutes. i mean it can only check the time like 23:17 (do not checks the seconds, and gives nothing if there are seconds in teh time also). can anybody extend it to seconds also?
regards
sAqIb
|
|
|
|
|
HI,
I am developing an application which downloads data from remote location in chunks. ie, the data is split into segments and all segments are to be downloaded parallely. The problem which occurs is that only about half of data is downloaded and then the execution stops!
Can anyone help me??
Ajay Cilly
(cilly_brain)
|
|
|
|
|
I want that user can select fields from form and than only that selected fields can display on the report using C# & ADo.NET connectivity.
Can anyone help me!!!!!
-- modified at 2:30 Thursday 28th September, 2006
|
|
|
|
|
There are few ways to do that,
1)If you have reports in your project itself you can use iteract with section items collection and make appripriate items suppress attribute to false.
2)If you have reports as report file(*.rpt) you can play around with the datasource,
a) Make sure you have selected verify database on every print
b) by using ADO.NET method fill a dataset with selected fileds,then set the datatable or dataview as a datasource for the report.
the second solution worked for me with a simple check list report,never tried the first one..
Good luck
Where there is a will,there is a way.
Where there is a will,there is a way.
|
|
|
|
|
We have a flash MP3 player that we are integrating with our database application. The mp3 files are stored in the database (SQL Server).
We would like to know how to feed a byte[] array to the src attribute of the flash file, so that we can play the mp3 files without writing them to disk first.
We already have an http handler utility that gets the mp3 files from the database and writes them to the output stream of the response object.
sanjeev
|
|
|
|
|
Make an aspx page that reads the dataout of the database then writes the bytes out directly (instead of html) use that page as the src on the flash (i.e. youpage.aspx?mp3id=45)
|
|
|
|
|
I have application in which it shows all the application currently running.Now I want to show the icon for the perticular Application along with the name but i a mnot able to retrive icon part.
Can anyone help me???
<marquee>nishu
|
|
|
|