|
I'm working on WPF project in which I need to implement ZoomIn / ZoomOut on Scrollviewer object with seperate pan zoom window. There are two types of transformation which can be applied i.e. Layout Transform & Render Transform. Now the problem is I want to use the best of both kind of transformation.
I have a pan zoom window which shows the view of my scroll viewer object.When the view of my scrollviewer object changes i notify to pan zoom window to reflect the view of scroll viewer object.
For transformation, scrollviewer object's three properties are important. ViewPortSize, ExtentSize and Offset. When ZoomIn is performed, ViewPortSize and ExtentSize remains same in both Layout and Render transformation while Offset value gets changed in layout transform but in Render transform scrollviewer object's offset value is not changing. Because of this in render transform, even if the view(or layout) of my scrollviewer object in main canvas has changed still I can not send the changed information to pan zoom window (as offset value is same).
So my problem is my ZoomIn / ZoomOut related requirements are perfectly satisfied using Render Transform but if I use Render transform I can not update my view in Pan Zoom Window. Can any one suggest me the work around for this problem.
(I want to implement the zooming in the same way as implemented in Microsoft Visio. Pressing ctrl key n mouse wheel move wil provide the zooming operation in visio)
Below I'm pasting one link in which the problem described is I think somewhat related to my problem.
https://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=991579&SiteID=1[^]
Hope I have been able to put up my question in proper way. Pls revert back in case more clarification needed. Thanks in advance.....
Krunal C
|
|
|
|
|
In the KeyDown event for my form, I have code that goes something like:
if (e.KeyCode == Keys.Right && e.Modifiers == Keys.Control)
{
textBox1.Focus();
textBox1.SelectAll();
}
So, when I press ctrl+right I'd like to focus on a text box and select all its text. But the right arrow press is processed by something else and so the cursor ends up at the end of the text box text with nothing selected. What's processing that right key press? How can I have ctrl+right select the text and not perform a right press in this one instance? Thanks for your help.
|
|
|
|
|
You can set e.Handled to true
|
|
|
|
|
Thanks again! I actually tried that before, must have made a mistake when testing it.
|
|
|
|
|
MSDN:
"Call the IsInputKey method to determine whether the key specified by the keyData parameter
is an input key that the control wants. This method is called during window message
preprocessing to determine whether the specified input key should be preprocessed or sent
directly to the control. If IsInputKey returns true, the specified key is sent directly to the
control. If IsInputKey returns false, the specified key is preprocessed and only sent to the
control if it is not consumed by the preprocessing phase. Keys that are preprocessed include
the TAB, RETURN, ESCAPE, and the UP ARROW, DOWN ARROW, LEFT ARROW, and RIGHT ARROW keys."
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips:
- make Visual display line numbers: Tools/Options/TextEditor/...
- show exceptions with ToString() to see all information
- before you ask a question here, search CodeProject, then Google
|
|
|
|
|
Dudes,
Is it possible to show the data in datagridviewrow /datagridview using the dataset(not using the wizard).
ex.
DataSet ds;
ds = new DataSet();
... if it is. can you give me the order of codings.
thanks u so much,
jeof
******************************
I just want to
know everything
|
|
|
|
|
Just give the dtg.. the DataSource and DataMember
"dtgCreditInfo.DataSource = ds;
dtgCreditInfo.DataMember = "TableName";"
Assaf
|
|
|
|
|
thanks assaf for your quick reply.
one more thing. what should i put in datagrid.
ex. (i used this using textbox)
txtUsrName_pca.Text = dataSet.Tables[0].Rows[0][3].ToString();
in datagrid, what will i used? is it the same?
******************************
I just want to
know everything
|
|
|
|
|
YourDataGridName.DataSource = YourDataSet;
Try this for example :
<br />
dgvAllData.DataSource = myDataSet;<br />
dgvAllData.DataMember = "ID";<br />
Hope can help
Regards,
Tomi
|
|
|
|
|
thanks tomi,
should i still use Fill method right.
heres my new code:
adp = new SqlDataAdapter(cmd);
ds = new DataSet(); <- should i comment this line?
dtg.DataSource = ds;
dtg.DataMember = "M_CUSTOMER";
adp.Fill(ds);
btw, i dont want to use statement in my code.
******************************
I just want to
know everything
|
|
|
|
|
in yur code you assign a value for the txt... from the dataset
if you want the to do the same from the datagrid:
txtUsrName_pca.Text = dtg.Rows[i].Cells["CreditCardOwner"].Value.ToString();
Assaf
|
|
|
|
|
thanks assaf,
Assaf82 wrote: from the dataset
if you want the to do the same from the datagrid:
txtUsrName_pca.Text = dtg.Rows[i].Cells["CreditCardOwner"].Value.ToString();
yes. i got it. whew
******************************
I just want to
know everything
|
|
|
|
|
|
hi assaf,
got an error when compiling.
'System.ArgumentException'
in this line
adp = new SqlDataAdapter(cmd);
ds = new DataSet();
dtg.DataSource = ds;
dtg.DataMember = "M_CUSTOMER"; --> got an error here!
adp.Fill(ds);
******************************
I just want to
know everything
|
|
|
|
|
This Exception here mean that the table "M_CUSTOMER" doesn't belong to the dataset "ds"
So verify when you run the program that the dataset contain this table and check his Name
hope that this help you ...
Assaf
|
|
|
|
|
hi,
i am new in c#,how to add values in below Dictionary
private Dictionary<string, Dictionary
<string, double>> batchTable = new
Dictionary<string, Dictionary<string, double>>();
parthiban
|
|
|
|
|
I have two different ways:
private Dictionary<<string, double>> innerTable;
private Dictionary<<string, Dictionary<<string, double>>>> outterTable;
public DataAccessLayer()
{
innerTable = new Dictionary<<string,double>>();
outterTable = new Dictionary<<string, Dictionary<<string, double>>>>();
innerTable.Add( "stringKey", 12312.012 );
outterTable.Add( "anotherStringKey", innerTable );
}
public class UsingMyNewCollections
{
public UsingMyNewCollections()
{
InnerDictionary inner = new InnerDictionary();
inner.Add( "StringKey", 1213.0123D );
OutterDictionary outter = new OutterDictionary();
batchTable.Add( "SomeKeyString", outter );
}
}
public class OutterDictionary : IDictionary<<string, InnerDictionary>>
{
private Dictionary<<string, InnerDictionary>> m_outterDictionary;
public OutterDictionary()
{
m_outterDictionary = new Dictionary<<string, InnerDictionary>>();
}
public void Add( string key, InnerDictionary value )
{
m_outterDictionary.Add( key, value );
}
#region IDictionary<<string,MyTable>> Members
#endregion
#region ICollection<<KeyValuePair<<string,MyTable>>>> Members
#endregion
#region IEnumerable<<KeyValuePair<<string,MyTable>>>> Members
#endregion
#region IEnumerable Members
#endregion
}
public class InnerDictionary : IDictionary<<string, double>>
{
private Dictionary<<string, double>> m_innerDictionary;
public InnerDictionary()
{
m_innerDictionary = new Dictionary<<string, double>>();
}
public void Add( string key, double value )
{
m_innerDictionary.Add( key, value );
}
#region IDictionary<<string,double>> Members
#endregion
#region ICollection<<KeyValuePair<<string,double>>>> Members
#endregion
#region IEnumerable<<KeyValuePair<<string,double>>>> Members
#endregion
#region IEnumerable Members
#endregion
}
MSDN on using the DictionaryBase.Dictionary[^]
I'm listening but I only speak GEEK.
|
|
|
|
|
hi i am student.im doing research about development of adaptive digital notch filter for the removal of 50Hz power line noise in ECG.i have a sample of 50Hz noise of ECG..now i need to call the file in mathlab..how must i do it?im very new to mathlab..please help me..
|
|
|
|
|
I think u have accidently landed up in the wrong place, you may try out the Hardware section for your query, u are most likely to find the right solution there. This is C# zone.
|
|
|
|
|
I have
Type propertyType
it can be of any type I want to separate types of Enum type for example
propertyType == typeof(System.Windows.Forms.AutoSizeMode)
or
propertyType == typeof(System.Windows.Forms.BorderStyle)
or
propertyType == typeof(System.Windows.Forms.CharacterCasing)
or
propertyType == typeof(System.Windows.Forms.FlatButtonAppearance)
and many more now I want to separate them from others like
propertyType == typeof(System.Drawing.Image)
can you help me
Thanks and Regards
Amar Chaudhary
It is Good to be Important but!
it is more Important to be Good
|
|
|
|
|
Are you asking how to detect all enum types without having to check for each specific type individually?
Enums derive from System.Enum - perhaps you could check that instead rather than have to list all enum types.
|
|
|
|
|
Solved
else if (propertyType.IsEnum)
{
result = Enum.Parse(propertyType, value);
}
actually this was my mistake as I was experimenting with
"System.Windows.Forms.Cursor" which is not enum
Thanks and Regards
Amar Chaudhary
It is Good to be Important but!
it is more Important to be Good
|
|
|
|
|
I update the DataSet but the DataGridView still show me the old Data
This my Code :
adap.SelectCommand = cmd;
ds.Tables.Remove("CreditCardInfo");
adap.Fill(ds, "CreditCardInfo");
dtgCreditInfo.DataSource = ds;
dtgCreditInfo.DataMember = "CreditCardInfo";
dtgCreditInfo.Update();
Please i need help, it's urgent
Thanks so much
Assaf
|
|
|
|
|
I'm sorry Assaf, what exactly u want to do ?
if u want to get the latest data why dont u use datatable.
Regards,
Tomi
|
|
|
|
|
I have alredy the data in the dataset,
the data i want to display in the datagridview i have it but the datagridview still show me the old data
"You mean to fill the datatable from the adap and reuse instead of the dataset?"
Thanks a lot
-- modified at 1:32 Monday 10th September, 2007
Assaf
|
|
|
|