|
I am sorry if I was not clear enough. I don't want to change theme for messagebox.
I want standard message box to appear, as soon as any user runs the application with my theme dll. Something like 'This is unregistered version of the theme'. I want to know how and where can I write code for this, inside my class library project.
|
|
|
|
|
I have been trying to implement merge cells/rows feature in WPF richtextbox containing flowdocument with table.
found no built-in method which supports table.merge(tablecells). One way i think is to get the table cells in selection, set rowspan, colspan accordingly for the left most cell and remove other cells in the selection. but fidning it difficult even to get the cells in the selection
foreach (var rowGroup in table.RowGroups)
{
foreach (var row in rowGroup.Rows)
{
foreach (var cell in row.Cells)
{
if (richTextBox.Selection.Contains(cell.ElementStart))
{
int rowIndex = rowGroup.Rows.IndexOf(row);
int colIndex = row.Cells.IndexOf(cell);
selectedTableCells.Add(new KeyValuePair<int, int>(rowIndex, colIndex), cell);
}
}
}
}
code above doesnot return the correct number of cells in the selection.
any help? Is there a better way to do this?
- Regards - J O N
A good thing is a bad thing if it keeps you from the best thing. - Dr. Adrian Rogers
|
|
|
|
|
Hello,
Im loading dynamically some DLL's in to my APP and i wont the DLL raise an event when some action happens.
How i need to define the event and how i subscribe my APP to handle this event?
Thanks
|
|
|
|
|
What kind of application is it? ..this question probably doesn't belong in the Silverlight forum.
|
|
|
|
|
I want to do some drag and copy operation between the listboxitems. But I have no idea about how to get a specific listboxitem's visual position in a listbox panel.
Assumpt that the size of each listboxitems are different, we can not get the LEFT property like (listboxitem.Width * (Index-1)). And seems the ListBox.ItemContainerGenerator can not help also.
Anyone can give a tips ?
|
|
|
|
|
This[^] might give you some ideas.
|
|
|
|
|
Hi All,
I am working on Tab Control in Silverlight. I need to Customize Tab Control Header.
(I need to Disable the existing one and put my TabItem Header in it).
I need to change size as per the size of the Page.
but it is not working and onclick the Images show at different levels
Please let me know the if you have any video or any dummy application where i can check and solve my problem.
Thanks in Advance
Mayur
|
|
|
|
|
Are you using TabControl.ItemTemplate to specify a template for the headers? Have you looked at the default template to see what you're working with?
TabControl Styles and Templates[^]
Mark Salsbery
|
|
|
|
|
I'm creating a ComboBox in my project that lists the installed Printers on my network. I have already been successful in creating the list and layout I wanted. But, I want to be able to display the same icons that you see next to them when you display your list in Vista or Windows 7. I have found a few articles online with people attempting the same thing but none that I have found have a real answer on how to go about this.
Currently I am using System.Management to acquire all of the information I need about the installed Printers with the exception of course to the icons.
Anyone have any suggestions on how to do this?
|
|
|
|
|
Use SHGetFileInfo to enumerate the printers virtual directory.
|
|
|
|
|
Yeah I read one link with that on it but I've never done anything like that so don't have a clue how too.
|
|
|
|
|
How to use the SHGetFileInfo function[^] is an example from MS on how to get associated icons.
Good luck!
When I was a coder, we worked on algorithms. Today, we memorize APIs for countless libraries — those libraries have the algorithms - Eric Allman
|
|
|
|
|
Wayne, thank you this will help me understand that a great deal. But, I am retrieving the installed printer information by using System.Management and querying Win32. I can simply add image references and display them next to those if that was all there was to it. But, I was wanting to know if there was a way when retrieving the list information to determine which image was being used to represent them or do I simply create that myself?
If you open your devices and printers right now you will see a fax icon next to a fax, a printer next to a printer, and a networked printer icon next to a networked one. Is the information used to display the proper image able to be retrieved in the same manner as obtaining the printer list or do I have to setup some sort of code that can determine if the printer information received is a fax and have it display a fax image?
|
|
|
|
|
You get that info with SHGetFileInfo. It gives you the HICON back if you call it appropriately.
|
|
|
|
|
Hi!
Relatively new to WPF though have worked a bit with XNA previously and feel fairly experienced with C#.
Building a WPF control for visualizing networks in 3d. I got the network data structure of custom Node and Edge objects and I clone a GeometryModel3D object to each for each of the nodes, drawing these in my ViewPort3D according to their coordinates (Point3d). I have also created a simple cylinder shaped GeometryModel3d object, coded as a xaml resource, with base circle on the xz-plane, stretching 1 unit up on the positive y axis. Each Edge object will refer to one of these, with the appropriate scaling and rotation to connect the nodes in the graph.
My idea is to first scale the cylinder along the y-axis to reflect the distance between two connected nodes, subsequently rotating the cylinder in the correct direction, finally translating the cylinder to the first node's coordinate.
Calculating the direction that the cylinder is easy: I then create a Vector3d based on the nodal coordinates. Can I use this (non-normalized) vector directly to make my cylinder point in this direction? How do I deal with the fact that the "unmodified" cylinder object is directed along the y-axis?
Also: the whole network will animate. Though not according to a storyboard: instead, the location of the nodes will change in a spring-embedded fashion (i.e. force-directed based on relations between them). This means that for each iteration (which will involve calculating new Point3d-coordinates for the nodes), I have to rescale, rerotate and reposition the cylinders (representing arcs/edges between the nodes). How should I do this? Should I "reinitialize" the GeometryModel3D cylinder for each relation and subsequently do the scaling, rotating and translation again? Or should I calculate the differences in length (scale), rotation and position for each step and modify each cylinder? Or should I translate back to its original state and then redo the operation? As I will be dealing with quite a lot of nodes and edges, garbage collection and cpu load might be an issue here.
Or is it possible to build a "skeleton" (dunno the terminology...) in WPF 3d, thus making these edges/cylinders automatically be rotated, scaled and positioned based on some anchor points (i.e. the nodal coordinates)?
|
|
|
|
|
Ah, I think I've figured it out - and learned a bit more about WPF 3d graphics! Havent written the code for it yet (not at the office), but posting a follow-up just if someone else stumbles upon this on the net.
My first mistake: rotation transforms (any transforms) arent cumulative. If I apply a rotation transform and need to modify the rotation later on, I dont need to redo the previous rotation before the second one. The original coordinates of the GeometryModel3D remains the same all the time - I just apply my new rotation and it will replace the old one.
My cylinder is standing on the xz-plane, pointing up on the y-axis with length 1. Scaling is no problem - I just scale it in the y-direction according to the distance between the two nodes.
Rotation was trickier but I think I have figured it out. To rotate the GeometryModel3d, I use the AxisAngleRotation3D(Vector3d, angle) class for the RotateTransform3D for the GeometryModel3d object.
What I need is the axis to rotate around, plus the number of degree to rotate. As the cylinder stands on the xz-plane, the rotation axis will always be on this plane. Based on the nodal coordinate P(x1,y1,z1), I get the rotation axis by simply setting Vrotate=(-z1,0,x1). So if I want to rotate my cylinder towards Point3d(2,3,1), I set the rotation axis to be Vector3d(-1,0,2)!
The rotation degree is the angle between a Vector3d(x,y,z) and the Y-axis (0,1,0), which is easily calculated by the shorthand:
theta = arccos( y / sqrt(x²+y²+z²) )
(...as the y-axis is normalized and, yes, on the y-axis!)
I thus end up with arguments for the AxisAngleRotation3D constructor, making it easy to rotate my cylinder towards the desired point!
Of course, the example above assumes that the first node is on the origo: the above must of course be modified to accept two arbitrary Point3d coordinates...
|
|
|
|
|
Currently when we create a listbox, we will get a default light blue border on the listboxitem if the mouse is over. I hope to remove the border so that it looks nothing happens. Is there a way to make this ?
|
|
|
|
|
|
|
Im Wpf Developer but I am Fun of silverlight I Desided Design Web Site With C# Silverlight Everthings ok if Im Not Put WMA(Any media or music) in xap But When I Put Even Music in xap Web Site Very Slow Opening and 2.nd Problem is on My Leptop web site verywell shown But When I try My Web Site at Another Pc or Leptop TextBlog Resized or Looking Not Properly. Here is My Web Site Adress http://carolineolivia.com
What I Do Wrong. And What ı must Do To Performance Up My Silverlight Web Site is Only 22,9 MB Thx For Your Hellp
|
|
|
|
|
This is a repost. Avoid posting the same question in multiple places.
|
|
|
|
|
Has nothing to do with Silverlight..
What's going on while that battery progress indicator is sitting there for an excruciating amount of time?
Mark Salsbery
|
|
|
|
|
|
Pardon? I have read that sentence several times now and I can't make head nor tails of it. Try to use punctuation and capitalisation just to give us a hint as to how the sentences should actually read.
|
|
|
|
|
Yes, your XAP file was pretty big but still should load way faster. Silverlight has nothing to do with how fast your XAP file is delivered - that's up to the server and yours seems very very slow.
Mark Salsbery
|
|
|
|