|
|
hi all
plz tell me hurriedly
muhammad mahmood ilyas
|
|
|
|
|
|
to specify that which event handler is attached with particular event
rahul
|
|
|
|
|
Hi
in C# how can i get the size of a file
Parshant
|
|
|
|
|
hi,
IO.FileInfo myfile = new FileInfo("c:\myfile");
myfile.Length // this is the size in bytes if i remember right...
|
|
|
|
|
hi
iwant to save my app setting (for exeample color,connectionString and ...) in app.config and retrieve it later .. how to do ??
thanks ..
|
|
|
|
|
What version of the framework are you using ?
The app config is just an XML file, you can write to it as such, I believe.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
u can add information to app.config by following way
< add key="color" value="red"/ >
and can retrive the value by
ConfigurationSettings.AppSettings["color"]
rahul
|
|
|
|
|
|
Hi friends,
I had planned to block access of other in my computer.Using bios how can i do that in c#.net.How to access and alter bios status of computer.Also Is it possible to do that in system information toolin XP
Gnanas
Gnanas
|
|
|
|
|
what exactly do you want to change? Afaik you are not able to change anything within the bios from the operating system... i even don't know anything else than the password protection for any "bios-protection-purposes". What do you mean when talking about the bios status? there is nothing like that. the bios is the "basic input output system" and provides some basic functionality for the "users" (by users the os devs are meant .
There are some "new age" bios (i forgot the name) which are entirely written in c or cpp (dont remember any more) - Afaik they are programmable though i don't know what "programmable" exactly means...
Please just clarify your question because i didn't get the point
|
|
|
|
|
mikone wrote: Please just clarify your question because i didn't get the point
Some new mobos provide a windows tool to update the bios instead of requiring users to try and find a floppy they can boot to do the same. I'm not aware of any windows APIs to do so, and would assume that the access is done via proprietary means via the motherboard drivers.
|
|
|
|
|
hi
i am working on a project which has a few capabilities of circuit maker
can someone help me making a line in c# such that it can be stretched and compressed, can be deletd, moved,etc
thanks in advance
Sameer Sood
|
|
|
|
|
If the line is persistent, you need to draw it in your OnPaint. IF you want to draw a drag line that will disappear, you can use CreateGraphics to do it. You're going to have to handle all your mouse events, and call Invalidate() to force a paint event, if you're going to draw in OnPaint.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
tnx for the reply bt i also understand that some events have to be handled, bt the question is how, and wat role does onpaint play here
Sameer Sood
|
|
|
|
|
Well, onpaint is where drawing happens, and you want to draw a line, right ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
ok that is clear bt how to move it and give it funstion like press delete key to delte it and enable selection on it and make it stretchable
there are lots of questions, tell me the methods and strategies , i have no idea.
Sameer Sood
|
|
|
|
|
Sounds to me like you want my rates to write it for you
First, you need to store your lines in a collection and draw them in your paint method. Then you need to write code to draw lines as you drag the mouse and add them to your collection when you lift the mouse.
If you want to select lines by drawing on them, you need to write code that works out if a pixel is close enough to a line to select it, probably first by working out if it's in the bounds of the box the line defines, then by walking the line if need be. Once you can select a line, you delete it by removing it from your collection, and calling Invalidate() ( which will redraw all the lines bar the one no longer there ). If you want to be able to click and drag it, then you basically want to draw focus points on the ends of the selected image, if you click inside one, you remove it from the collection, but make it the line being drawn, then your code to add lines will also allow you to move it.
Lots to do. In the first instance, make sure you understand the way Windows draws stuff, and crack a good GDI+ book.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
since this is not a graphic-only problem, you will have to do more than just override some controls onpaint method. you also will have to handle the "physics" of the line. If you even are not familiar with drawing, you should start reading some GDI+ tutorials - there you will learn to create basic (and more advanced) shapes and how to handle the whole drawing stuff. when you got familiar with it, you will have a basic knowledge about drawing and you also will get an idea on how to realize what you want to do.
to sum it up - there is no qnd solution for your problem i would know of - start learning to draw with gdi+
// edit: some strategies
you could do it like this:
you have a lineclass which has some properties - XStart, YStart (Maybe a point object called start? , XEnd, YEnd.
Now you will have to put add an eventlistener to the click event. when the mousebutton is clicked, you will have to check whether its near the line or not.
if it is near the line, you will have to remember the mousecursor position and add a eventlistener to the mouseup event. when this happens, you will have a difference between the old and the new cursor position.
you can take this value to modify your line object which is drawn by the onpaint method. sounds a bit complicated but it isn't that difficulty at all...
|
|
|
|
|
now that's like a professional
Tnx for the replies, i 'll learn gdi+ , bt mikone u must knw that there will be not one but many lines in my case as i am going to make a tool that will make Data flow diagrams like smartdraw, its a college assignment. i 'll try and post again if i have more such problems
tnx again
Sameer Sood
|
|
|
|
|
hi,
i have a few quesions :
1. How do i highlight a entire row?
this is what i have now:
dataGridView1.Rows[index].Cells[0].Style.BackColor = Color.Red ;
dataGridView1.Rows[index].Cells[1].Style.BackColor = Color.Red;
index is the last row, but i still have to tell what column, is there way to select all culmns?
2. how do i sort on a letter in an entire table (like a search button)
this is what i have now:
private void btn_sort_Click(object sender, EventArgs e)
{
db1DataSet.tabel1.DefaultView.RowFilter = " name LIKE '%" + txt_sort.Text + "%' ";
dataGridView2.DataSource=db1DataSet.tabel1.DefaultView;
}
name is a column, again is there a way to select all the columns?
3. How do i delete more then one row at the time. (select in a datagrid)
this is what i have now:
try
{
db1DataSet.tabel1.Rows[dataGridView1.CurrentRow.Index].Delete();
tabel1TableAdapter.Update(db1DataSet.tabel1);
db1DataSet.AcceptChanges();
this.tabel1TableAdapter.Fill(this.db1DataSet.tabel1);
Application.DoEvents();
}
catch (System.Exception ex)
{
db1DataSet.RejectChanges();
lbl_error.Text= ex.Message;
}
here i just delete the selected item, the one with the arrow nextto in the grid
if there is anyone with some idea's let me know :p
thxx
|
|
|
|
|
faladrim wrote: db1DataSet.tabel1.DefaultView.RowFilter = " name LIKE '%" + txt_sort.Text + "%' ";
Get rid of the % before txt_sort and it will sort alphabetically for you.
faladrim wrote: How do i delete more then one row at the time. (select in a datagrid)
Probably by writing the SQL to delete the right items.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi
1.Select entire row in datagrid :
<br />
private void dataGrid_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)<br />
{<br />
System.Drawing.Point pt = new Point(e.X, e.Y); <br />
DataGrid.HitTestInfo hti = dataGridSearch.HitTest(pt); <br />
<br />
if (hti.Row == dataGridSearch.VisibleRowCount-1)
return ;<br />
dataGrid.Select(hti.Row);<br />
} <br />
2.
I didn't understand
clicking on datagrid's column headers can sort columns.
3.Delete multi rows :
You should add one checked (boolean) column to your dataset's table. then datagrid show it, after user checks this columns, you can find checked chekboxes and delete them all.
|
|
|
|
|
a little more about the sorting,
i only show the items that contain the text form the textbox,
maybe sorting istn the right word :p
more like a search
and thx
|
|
|
|