|
Hi all,
I am to implement a windows explorer like in C# where the treeview is a list of clients, each client can have > 1 office (child node). These clients are from the database and eventualy will become folder names. My listview will contain template files for each client/office. I can drag and drop files onto my application but i can't do the other way arround.
Is there anyone has an example, please!!!
Thank you very much for any help.
Ha
|
|
|
|
|
Which class does the FindControl method belong to. I need to be able to return which controls lie on a form. E.g. if there is a textbox on the form i should be able to return a messagebox which says that the textbox(textbox_name) exists on the form. Any suggestions please
|
|
|
|
|
There is a Controls collection that you can iterate through. As it does not have a find method, I doubt there's another class offering this facility, but you can iterate through and search yourself.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
There is a FindControl method referred to by you in the System.Web.UI.Control class. However, apparently there is no such method in the System.Windows.Forms.Control class from which the Form class is derived.
But, as suggested by Christian Grauss, you can use the Controls property of the Form class alongwith the ControlCollection class member methods to iterate through the controls on a form.
Regards,
Ashok Dhamija
_____________________________
Padam Technologies
|
|
|
|
|
Hey all,
got an issues thats been stumping me for a few days now, and instead of coming to you guys first (like i knew i should have) i've wasted about 3-4 days worth of good time, beating my head against the wall on this issue.....!!!
Using postgres database, PgSqlClient ADO.Net Data Provider, and VS'03.
I'm having a problem populating a comboBox with data from Postgres...well rather i'm having problems getting the value member to co-operate...
I've got a "users" table set up with 3 columns, well 4(oid), user_id -serial-&(pk), user_fname -text-, and user_email -text-. Database is pre-existant, so we can't change anything on it. The user table is refrenced by nearly every other table in the db, and I'm trying to ref it in the "calls" table.
The comboBox comes into play when I have the operator entering the callers info into a textbox then selecting the users name (call recieved by...."user_fname") from the comboBox...
I can populate it nice and pretty, just like I want, until the operator selects a name and it(comboBox) writes the valuemember of the comboBox, not the database to the table. So comboBox1.valueMember = "user_id"; says that "user_fname"(DisplayMember) Carlton should be ref at the db to serial 19, but since it is 4th on the list(not alphabetical,rather sorted by the db as a select...from....where user_email = support@blah.com) so it writes to the db as user_id 4 which obviously translates to someone else...which is really, really screwing up my call log...!
now, i've tried just about everything i can think of to fix this...and i'm sure it something simple i've missed...i'm okay with that!
but i've tried:
dataReaders, and a while datareader(reads) { comboBox1.Items.Add(dataReader.getValue(0)) }
dataAdapters, adapter1.Fill(dSet1,"users"); comboBox1.DataSource=dSet1.Tables["users"]; comboBox1.DisplayMember="user_fname"; comboBox1.ValueMember="user_id";
i've tried an array, but forgot what i did(late, late night, too many beers)
and so far nothing has worked to give me the proper valuemember i need to the database refrence.
Please Help!!!
Oh, and please note that the code samples above were NOT the copy/paste from my real work, so don't say thats its cause i didn't capitolize or spell correctly something....lol.....
Dim Beautiful As String
Beautiful = "ignorant"
Label1.Text = "The world is full of " & Beautiful & " people."
Why is common sense such an un-common comodity?
|
|
|
|
|
Ok, so it seems that i was all the time looking in the wrong dirrection...it wasn't my comboBox population that was failing..it was the insert to the db that was causing the issue...i in my haste set a parameter up that looked to the selected ITEM, not the selected Value...
Correction made,
Have a nice night.
Dim Beautiful As String
Beautiful = "ignorant"
Label1.Text = "The world is full of " & Beautiful & " people."
Why is common sense such an un-common comodity?
|
|
|
|
|
I am using DateTimePicker in my application, and it works fine. The problem is after I select a date, the display does not close. How do I get it to close??? Please help.
Norm
|
|
|
|
|
hey,
I have a form with multiple panels. when I switch a different panel to the front via the "bringtofront" method, and send the top one to the back via the "sendtoback" method, the background image for the panel I'm trying to bring to the front is not redrawn. I have tried invalidating and refreshing the form and it's client controls, have tried the same with the panel. I'm not having any luck. The images are imported resources, I don't think reassigning the image is the proper way, surely there's a way to persist the graphics back onto the background image of the panel. I'm thankful for your help,
Stephen
|
|
|
|
|
Anyone knows about a .NET wrapper for OpenSSL
I found a solution in mentalist but I think they started a new implementation instead of using the OpenSSL functions
|
|
|
|
|
Hi All,
Is it possible to have the colour of a Datagrid row different from the
other rows depending on the value in one of the cells.
For example if I have a list of products and prices can I make the row
highlighted red if the price is 0.00
If so how do I go about doing it?
Thanks
Web design and hosting
http://www.kayess.com.au
|
|
|
|
|
If you have a web form, override the ItemDataBound event.
Peter Molnar
|
|
|
|
|
Hi,
It is a Windows form control
Web design and hosting
http://www.kayess.com.au
|
|
|
|
|
|
In your form class after you added the grid to the form add:
DataGridColoredRowColumn aTextColumn;<br />
for (int i = 1; i < numColumns; i++) {<br />
aTextColumn = new DataGridColoredRowBoxColumn ();}<br />
<br />
this.datagridStyle.GridColumnStyles.Add(aTextColumn);<br />
<br />
Add a new class DataGridColoredRowBoxColumn, in which you will override the paint method.
<br />
public class DataGridColoredRowBoxColumn : DataGridTextBoxColumn <br />
{<br />
<br />
protected override void Paint(System.Drawing.Graphics g, System.Drawing.Rectangle bounds, CurrencyManager source, int rowNum, System.Drawing.Brush backBrush, System.Drawing.Brush foreBrush, bool alignToRight) <br />
{ <br />
try { <br />
object o = this.GetColumnValueAtRow(source, rowNum);<br />
if( o!= null) { <br />
string str = (string)o;<br />
if (str == "WHATEVER YOU COMPARE TOO") {<br />
backBrush = new SolidBrush(Color.Pink); <br />
} <br />
} <br />
catch (Exception) {}<br />
finally {<br />
base.Paint(g, bounds, source, rowNum, backBrush, foreBrush, alignToRight); }<br />
<br />
} <br />
<br />
<br />
}<br />
|
|
|
|
|
I'm not sure if this is the forum to post this question, but I would be very appreciative if someone could point me in the right direction.
I'm using Managed DirectX (August 2005 update) to draw 3d graphics using C# as the base language. I'm learning as I go (as usual -- hehe ) and I can't figure out how to do something.
I need to be able to copy the contents of a directX window to the clipboard. When I was using OpenGL, I would get the data into a .NET Bitmap object (by copying pixels over into the BitmapData) and then copy that bitmap object to the clipboard. I can't seem to be able to wrap my head around this concept in DirectX, though...if it's even possible. I've discovered how to save a screenshot to a .bmp file (using the Surface object), but haven't been able to find anything about the clipboard.
Is there a way to get the screenshot into a .NET Bitmap object from DirectX? Has anyone ever done this before?
Thanks for your help.
Erica
|
|
|
|
|
Is there a way to enable auto-increment version on build? I'm talking about the visual c# 2005 express edition beta 2
IM PROUD TO BE A GMAIL;
|
|
|
|
|
I don't believe so, I store the version number in the app settings and run a post build step to increment it for my app.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Yes, in your AssemblyInfo.cs file, include the following:
[assembly: AssemblyVersion("1.0.*")]
|
|
|
|
|
I want my program to read in an HTML file on the internet into a string, how do i go about doing this?
Thanks in advance,
RWSTF.
|
|
|
|
|
1.Download the file. Look up for this HttpWebRequest, or WebClient in MSDN (WebClient is somewhat easier to use for the first time). If you dont know, also look up HTTP communication
2.Save the the downloaded string into a text file, look up IO e.g.: StreamWriter
Peter Molnar
|
|
|
|
|
Hello gurus,
I'd like to know how to avoid an application closing when calculations are being performed?
I tried to trap the Closing event and set the e.Cancel to false , but it quits anyway
<br />
private void frmMain_Closing(object sender, System.ComponentModel.CancelEventArgs e)<br />
{<br />
if (_permuting)<br />
e.Cancel=!_permuting;<br />
}<br />
Thanks for the help.
There is no spoon.
|
|
|
|
|
What is "closing" your app? How do you know your catching the right method? What about Application.Exit()????
/\ |_ E X E GG
|
|
|
|
|
This is a multithreading issue.
1.Spawn a worker thread with the the long calculation
Thread m_Thread;
...
m_Thread = new Thread(new ThreadStart(MyLongCalculationFunction));
m_Thread.Start();
2.In your Form_Closing handler check the thread state
if (m_Thread.ThreadState == ThreadState.Running) ...
If running, dont let the dialog close by giving
e.Cancel = true;
Peter Molnar
|
|
|
|
|
private DateTimePicker dtp1;
private DateTimePicker dtp2;
//Assumptions:
// both these instance of DateTimePicker showing time in Custom format that is hh:mm tt
//dtp2 is always greater or equal to dtp1
//when i calculate timeSpan(Difference) between these tow instances' values the the expected(requird) and actual result is as follows;
dtp1============dtp2============dtp2-dtp1(Actual)=======Dtp2-dtp1(Required)
07:15PM=========07:15PM=========00:00:00===============00:00
07:15PM=========11:05PM=========03:50:00===============03:50
07:15PM=========12:05AM========-19:10:00(-ve)===========04:50
08:00PM=========08:00AM========-12:00:00(-ve)===========12:00
Please help me how to solve this problem to get the required output
|
|
|
|
|
if ((dtp2-dtp1) <0)
return (dtp2-dtp1);
else return (dtp1-dtp2)
-- modified at 15:02 Wednesday 21st September, 2005
The reason for the negatives is that since you're not including a day, 12:05am is regarded as the begining of day1, not the start of day2.
|
|
|
|