|
i am using a panel because my app is used for making diagrams, so al objects other than lines are user controls, and secondly how to do that in memory,Do you mean that i shoul draw lines manually on the bitmap i am gonna save?
Sameer Sood
Microsoft Student partner
NIT Durgapur,india
|
|
|
|
|
ssoffline wrote: so al objects other than lines are user controls
No, they should be different classes with a common base class, which are used to draw the objects on your main control.
ssoffline wrote: Do you mean that i shoul draw lines manually on the bitmap i am gonna save?
Yes, obviously. If you don't draw lines on the bitmap, when you save the bitmap, they aren't going to be there, are they ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
ok thanks i 'll try and tell
also i posted earlier today how to make lines resizable?
i mean i should be able to select them like controls and resize with mouse?
i can move them but how to resize?
Sameer Sood
Microsoft Student partner
NIT Durgapur,india
|
|
|
|
|
ssoffline wrote: i mean i should be able to select them like controls and resize with mouse?
The way to do this is to create a struct that defines each item. Then keep them in a list, and render them from that list. when the user clicks, you iterate over the list and see if an item was selected. If so, you change the attributes of that object in the list when the user drags or whatever.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
hi
thanks for previous suggestions, i am already doing the same only, in fact i can save and compile my diagram and even reopen it using XML, my problem is how to show those selected points as are shown in windows form editor around that graphics object, of course if it becomes selectable like other controls then resizing is no big thing.
Sameer Sood
Microsoft Student partner
NIT Durgapur,india
|
|
|
|
|
actually when you move window or minimize/maximize it all the controls redrwan but since you have written your code in some function that doesn't get refresh.Do one thing put that code in in OnPaint() method of your form.you'll be able to show your alll the time
sameer
|
|
|
|
|
@sameer
i am doing that in onpaint event only and they don't diappear in maximize minimize
Sameer Sood
Microsoft Student partner
NIT Durgapur,india
|
|
|
|
|
Hi there, I wonder if anyone can help... i have a small issue with typed datasets, specifically my row (see below) variable has intellisense for my fields as it should because its a typed dataset... but ds.LOB.Rows[0]. etc etc.. i can't seem to get the fields to show up
Basically i am trying to add certain data from Row 0 from ds and ds1 ... they both only have 1 row ... to a new row in ds2... the new row in ds2 shows all its typed fields... but the ds and ds1 do not..
of course if do the old fashioned way of row.Value = ds.LOB.Rows[0]["myField"].ToString() then it works ....
Every single dataset below is a typed dataset.
Here is what is happening
CD.LOBDataSet ds = new CD.LOBDataSet();
CD.LODDataSet ds1 = new CD.LODDataSet();
ds.Merge(testdata.Data); // testdata is just a class with a dataset
ds1.Merge(testdata.Data1); // testdata is just a class with a dataset
// Now I have data in ds and ds1 ..
// i have proved there is data there...
// Now going to add data to ds2 from ds/ds1
CD.LOTempDataSet ds2 = new CD.LOTempDataSet();
CD.LOTempDataSet.LOTempRow row;
row = ds2.LOTemp.NewLOTempRow();
// below both field names Description and Value show up in intellisense as it is a typed dataset
row.Description = "This is a test!";
row.Value = ds.LOB.Rows[0]. // this line.. row.Value is a field and has intellisense but ds.LOB doesn't
Any help anyone can offer would be gratefully appreciated
Thanks in advance
Ian
|
|
|
|
|
Have you tried casting ds.LOB.Rows[0] to a typed row?
|
|
|
|
|
No I didn't know you had to .... can you give me an example?
Thanks
Ian
|
|
|
|
|
I'm not sure this will work for you, but it's worth a try:
NewLOTempRow row = ds.LOB.Rows[0] as NewLOTempRow;
if(row != null)
{
row.
}
The question is, of course, whether the row itself is a NewLOTempRow. If it isn't, then you're losing your custom fields. If that is the case, let me know, I have another idea what it could be.
|
|
|
|
|
Excellent! THat worked great
Thanks!
Ian
|
|
|
|
|
where can i find free c# to download, and a beginner's manual?
daniela
|
|
|
|
|
Hi daniela,
On this site:
http://msdn.microsoft.com/vstudio/express/visualcsharp/
You can download C# express edition for free.
I don't know where to find a beginner's manual......
Good luck!
|
|
|
|
|
|
|
If you want a really good beginner's book, look at C# Step by step. I don't normally recommend MS books, but the Step by Step series is a very good one for getting started with something new.
HTH
WhiteWizard
aka Gandalf
|
|
|
|
|
Hi Everybody
I have a question I wish someone help me with his answer and why
Do you prefer data binding - which is ready with c#- or doing it yourself -I mean to write the complete code yourself?
Really I tried the two but I found data binding is fast but may come with error that hardly you find it, on the other hand Writting the code by myself is safe and easy to find any errors but very long time I take!!!!!!!!!
Regards,
Hisham Galal <me4webby@yahoo.com>
|
|
|
|
|
I prefer writing the hook up code myself, however, you can save time and bugs by having databinding do it for you.
|
|
|
|
|
i make databinding and change query strings and other parameters in code where required it saves time and iss more reliable but this meathod dosent work so well with crystal reports ( in case when you have schema changes in dataset )
It is Good to be Important but!
it is more Important to be Good
|
|
|
|
|
how to select a perticular cell on DataGridView.Are there any method? without
" cell.selected=true " are there any? same....tell me how to move on cell by
arrow skipping unwanted columns...every code sample with DataGridView Control
plz post to me......i welcome all.
additional***
i want to select a cell (set focus to the cell) it means when cell got F2 mode.i'm developing VS.net 2005 IDE.here in a cell select and press F2 it comes to edit mode.i want set focus to a cell programitically.send sorce code.
like "TextBox.Focus()" the same thing should happen here also..
-- modified at 9:08 Monday 16th October, 2006
|
|
|
|
|
To select a particuler row follow the following code.
DataGrid.CurrentRowIndex = 4;
DataGrid.Select();
i am not clear with the secod part of your question.
what i got is how to select row on pressing arrow key.
if it is the question then trap the key arrow keys in keyDown event of data grid i.e. datagrid_keyDown(sendr,evenrargs){}
trap arrow keys and select the currentrow index
sameer
|
|
|
|
|
thanks lot for answering to my question...but it's not answer what i expect.
i want to select a cell (set focus to the cell) it means when cell got F2 mode.i'm developing VS.net 2005 IDE.here in a cell select and press F2 it comes to edit mode.i want set focus to a cell programitically.send sorce code.
like "TextBox.Focus()" the same thing should happen here also..
|
|
|
|
|
hope you are able to put grid edit mode.it'll solve your problem
DataGridCell cell = this.myDataGrid1.CurrentCell;
cell.RowNumber=5;
cell.ColumnNumber=2;
this.myDataGrid1.CurrentCell = cell;
sameer
|
|
|
|
|
Hi all,
I want to retrieve settings (connection string etc) from app.config and that shouldn't be a big problem, I thought.
My app.config looks a little like this:
<configuration><br />
<configSections><br />
</configSections><br />
<connectionStrings><br />
<add name="vrsConnectionString" <br />
connectionString="Data Source=LT01;Initial Catalog=vrs;Integrated Security=True"<br />
providerName="System.Data.SqlClient" /><br />
</connectionStrings><br />
</configuration>
Searching at the web says I can use something like:
System.Configuration.ConfigurationManager.AppSettings[key]
where key should be replaced with "vrsConnectionString", I presume.
But I can't find that.
I have the:
System.Configuration.ConfigurationSettings.AppSettings[key] (which is obsolete)
And using that returns a null value, I.e. haven't found the key.
I have added: using System.Configuration to my code.
I'm using .Net 2.0.50727
MS Visual Studio 2005 ver: 8.050727.42
Anyone who can explain what I'm doing wrong here?
Mike
|
|
|
|