|
It's hard to explain...but I get a bad feeling about what you are trying to do here. If you want to have an area that dynamically changes, I'd recommend a somewhat different approach that more cleanly fits into the windows paradygm.
What I would do is to have a single panel. Each set of controls would be removed from the form and created as individual UserControl objects. When the need comes to show the different view, clear the controls in the panel and create/add the required user controls. You can modify the constructor of the controls passing whatever data is needed to initialize the view.
If you find that the controls don't sit just right in the panel you can add some logic such as this:
panel.Controls.Add( functionControl );
functionControl.Docking = Docking.Full;
form1.Invalidate();
So you add the control, dock it so it fills the panel, then invalidate the form to get the new control visible.
|
|
|
|
|
I have found a ListView control on the web that has been extended to include additional functionality. Unfortunately it now has a problem. When you click on a ListViewItem it does not select it. i.e. it does not highlight the item like it would normally in a normal ListView control.
Could you tell me what events and methods I should change to make it select an item when the user clicks on one item?
Much appreciated.
|
|
|
|
|
Can you provide a link to the ListView control as they can vary greatly?
You know you're a Land Rover owner when the best route from point A to point B is through the mud.
Ed
|
|
|
|
|
hi all,
DataTable dset2 = new DataTable();
OleDbDataAdapter adp2;
adp2 = new OleDbDataAdapter("Select password From Users Where username = " + "\"" + textBox1.Text + "\"", conn);
adp2.Fill(dset2);
how will i check passwords in database with the one entered ?
if (dset2.Rows[i].ToString()==textBox2.Text) ???
how can i get passwords in dset ? help please ...
|
|
|
|
|
DataTable dset2 = new DataTable();<br />
OleDbDataAdapter adp2;<br />
adp2 = new OleDbDataAdapter("Select password From Users Where username = '" + textBox1.Text + "'", conn);<br />
adp2.Fill(dset2);<br />
if (dset2.Rows.count > 0)<br />
{<br />
}<br />
else<br />
{<br />
}
|
|
|
|
|
Message Closed
modified 27-Apr-15 11:00am.
|
|
|
|
|
You can find the data in the rows and columns i.e like this:
string pwd = dset2.Rows[i].ItemArray[i].ToString();
Since you're asking for password for one specific user, you can do this:
string pwd = dset2.Rows[0]["Password"].ToString();
string pwd = dset2.Rows[0].ItemArray[0].ToString();
-Larantz-
|
|
|
|
|
Hi,
I need help with writing code to call the NetFileEnum and NetFileClose functions from the NetAPI32.dll using C#.
Basically am trying to enumerate open file connections on a network resource and be able to close those connections similiar to the Computer Management MMC snapin Shared Folders>Open Files.
Thanks in advance...
|
|
|
|
|
hi, all.
how can i get the time 'exactly' in this format : 5/26/2006 12:59:59 AM
lblLoginTime.Text = Convert.ToDateTime(DateTime.Now.Date.ToString()).ToString("MM/dd/yyyy hh:mm:ss");
this just gives me : 5/26/2006 00:00:00 ???
where am i doing wrong ?
|
|
|
|
|
Hi,
Do like this:
DateTime.Now.ToString()).ToString("MM/dd/yyyy hh:mm:ss")
Hope this help you.
Best Regards,
Apurva Kaushal
|
|
|
|
|
try to use
lblLoginTime.Text = Convert.ToDateTime(DateTime.Now.Date.ToString()).ToString("MM/dd/yyyy"+" "+Convert.ToDateTime(DateTime.Now.TimeOfDay.ToString()).ToString("HH:mm:ss")
rahul
|
|
|
|
|
This code gives this result
MM/dd/yyyyHH:mm:ss
whithout space between Date and Time
|
|
|
|
|
Message Closed
modified 27-Apr-15 11:00am.
|
|
|
|
|
Custom DateTime Format Strings[^]
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
www.troschuetz.de
|
|
|
|
|
try to use
lblLoginTime.Text = Convert.ToDateTime(DateTime.Now.Date.ToString()).ToString("MM/dd/yyyy"+" "+Convert.ToDateTime(DateTime.Now.TimeOfDay.ToString()).ToLongTimeString();
rahul
|
|
|
|
|
Just following your logic makes my brain ache!
DateTime.Now -> returns an instance of DateTime.
.Date -> gets JUSt the date part
.ToString() converts the DateTime instance to a string according to your PC settings
then:
Convert.ToDateTime(DateTime.Now.Date.ToString()) --> Convert a DateTime to a striing, then convert that string back to a dateTime..
and finally
ToString("MM/dd/yyyy hh:mm:ss") --> convert the whole lot back to a string.
How on earth did you come up with such a convoluted way of doing it? The reason you were getting just the date and 00:00:00 as the time is bacause thats exactly what you asked for by callin .Date on DateTime.Now
All you needed was:
DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss")
and you would have got todays date and time in your required format.
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
Hi,
I have made a installer of My Windows Application (C# 2005 Express) and ported my software to a different computer. my installer installes SQL Server 2005 Express in the target machine at first then copy my software. When I installed the software in that computer and I clicked to run, I got the following error message and Program shut down.
.........................................................................
An error has occured while establishing a connection to the server.
When connecting to SQL Server 2005, this failure may be caused by the fact
that under the default settings SQL Server does not allow remote
connections. (Provider: SQL Netowrk Interfaces, error:26 - Error locating
Server/Instance specified.)
..........................................................................
Would you please guide me about this problem. Why it is looking for remote connection, It is not something like ASP.NET connecting thru Website or something like that. it is the very mdf file which is already available in the same PC and it should be accesssible thru the connection string I programmed in the application, right ?
Thanks and regards
Emran
|
|
|
|
|
Sounds like the SQL server isn't configured to allow incoming calls.
I'm not familiar with SQL Server 2005, but Oracle needs to have listenerservices running.
Might be a similar thing.
-Larantz-
|
|
|
|
|
Please help me...
I'd like to implement a depth first search method..
Or breadth first search,or both of them.
Please help me quickly...
|
|
|
|
|
Sounds like homework, or an examn maybe? ^^
-Larantz-
|
|
|
|
|
Best Regards,
Apurva Kaushal
|
|
|
|
|
It's not exaxtly homework,but i'll use it as small part in a big project...u can help me..
|
|
|
|
|
hi Al Friend
i Developing application by C#
i get All user in Domain by LDAP, i get user in Groups
But i dont know get Premission of that Groups
can some friend help me !
thanks
|
|
|
|
|
Dear friends,
Is it possible to bind the fields of structure to the controls on the form ?
For example.. i got a structure
struct Student
{
String firstName;
String lastName;
// and many other fields and properties
}
Now i got a *form* in which many text boxes are present related to the student. I am initializing form as follows;
txtBoxFirstName.text = student.firstName;
txtBoxLastName.text = student.lastName;
// and so on
Similarly when the form is dismissed, i read the changes back to the structure as:
student.firstName = txtBoxFirstName.text;
student.lastName = txtBoxLastName.text;
// and so on
Now, the problem is that the *Student* structure is very simple containing two fields, as such i need two text boxes on the form. But what if it contains 10 or 15 fields. As such i need to manually read each of the field value from the structure and displaying it in each of the edit controls. And then manually read changes from each edit control to the structure fields.
Is it possible to directly *bind* the strucute fields with the edit controls. It is very easy in ADO.NET. But i dont know whether it is possible in my case ?
Imtiaz
|
|
|
|
|
Can #define be used to define string constants as we do in C lang?
e.g. #define FIELD "Field"
the statement gives an error saying, "Single line comment or end of line expected"
Is this the limitation of the c# language ( no offences meant to c# gurus ) or is there any different systax to be used? Please help.
Thanking in advance.
-- modified at 2:28 Friday 26th May, 2006
|
|
|
|