|
|
Hello,
I have a question regarding the crystal report. I have a program that will print custom bills and I use for that crystal report, the user can not view the report its only called to be printed.
The database connection used has a local path on my computer. How can I make it dynamic so I can use it on other computers as well?
Thanks.
Regards,
Butterfly
|
|
|
|
|
I simply created a Windows Control Library project in VS. I add 2 user control form. On one form there is only a button and the sencond user control form i add a text box. So let say i want to import only one of them in my another project how do i do this. I don't want to import or add reference for both user control.
Secondly when i looked at my usercontrol project debug directory it created a project dll. I want dll for specific one.
thanks
|
|
|
|
|
If the controls are in the same project you have no choice, you will get both as you are referencing the assembly, not the controls.
only two letters away from being an asset
|
|
|
|
|
Hello. I'm using VS 2005 and I have taken over a project that has images included in the resources of the project that are visible by going to the project's properties sheet and clicking on the 'Resources' tab. Is there a way I can update this while building? For instance, there's about 50 images in there now associated with 'Company 1'. I'd like to have it where I can use different images when I do a build, depending on whether COMPANY1 or COMPANY2 is defined for that build configuration. Even doing it dynamically at runtime depending on a registry setting or something if I could put the images in a .resx file and have the program use that instead of the ones in the 'Resources' tab.
Thanks in advance
|
|
|
|
|
Maybe what you need is 3 projects (1 dll and 2 exe):
1 dll with all or most of the code
1 exe for each company, including all the appropriate images and referencing the code dll.
Alternative:
You could create extra projects with an image-only dll for each company,
and keep all code in the single exe, which then dynamically loads the right image dll.
(search for "late binding" on CP).
Luc Pattyn
|
|
|
|
|
I think the alternative solution would be what I would like to go with. however, I still don't have a clue as to how to tell the .exe to use the image dll as opposed to using the images that are in 'Resources' on the properties page for the project.
|
|
|
|
|
Well, I have not done this myself, but this is how I understand it:
- you make a new project targetting a dll instead of an exe,
and you add your images to that project just as you did so far for your exe project
- in your existing exe project, you remove the images you currently have as resources;
and you add code to decide which image dll is required (assuming you did build more than
one image dll), you then load it dynamically, and then get the images from there.
For dynamic dll load, and how to get at its content, please search "late binding" on CP.
Come to think of it, there must be yet another alternative, based on internationalization;
this is an official mechanism to support alternate sets of resources, normally intended
to easily port your app to other languages/countries without changing the main code.
I guess you could use it to just substitute alternate sets of images (and maybe some strings,
such as company name).
This too I have never done, and it also involves extra dlls, so it is very similar (if not
identical) to what I described earlier. One possible difference is internationalization
also supports a "default" country/language, which can be built-in (i.e. when no country-specific
dlls are available or selected). More on this surely in the MS documentation.
-- modified at 14:22 Monday 29th January, 2007
Luc Pattyn
|
|
|
|
|
I used to do this to retrieve the data of the table cell through WebBrowser object in VB.
txtresult = WebBrowser0.Document.all.tags("Table")(TableNo).Rows(RowNo).Cells(ColNo).innertext
TableNo: the ordinal number of the table in HTML page.
How can i do the same thing in C#? I tried many ways but all i got is error
Can i get some help pls?
|
|
|
|
|
teeboss wrote: How can i do the same thing in C#? I tried many ways but all i got is error
Use [] brackets for indexer properties in C#
|
|
|
|
|
just change [] -> ()? And the code is:
txtResult.Text = WebBrowser0.Document.all.tags("Table")[TableNo].Rows[RowNo].Cells[ColNo].innertext
would it work? I recieved the error "no property..."
Can u explain in detail pls?
|
|
|
|
|
He told you all you need to know, in C# it's square brackets, any error you get now, is because the code is wrong.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
I have a datatable that contains 10 columns (Say they are called column1, column2, column3, etc).
I have a schema that contains column3 (meaning I only want to create an XML file containing this column).
How would I export only column3 from my datatable into an XML file based off a supplied schema file ?
Thanks
|
|
|
|
|
Dear all,
I've searched high and low to find an example of a way to preview and print a single panel. I found a few ( very expensive ) commercial libraries , but I don't want to go down that path. Is there anyone who could help me out , or at least point me in the right direction on how it's done.
Kind regards,
Rick
|
|
|
|
|
Hi,
isn't any of this hits[^] what you need?
Robert
|
|
|
|
|
This is how you build the printpreview functionality. whatever is in the printDocument1 object gets printed or previewed on the screen.
PrintPreviewDiag ppd = new PrintPreviewDialog();
ppd.Document =printDocument1;
ppd.ShowDialog();
|
|
|
|
|
How do you customize a label control so that I can change the border color? I have searched high and low for examples/samples for a "label" control but found absolutely nothing.
Should I create my own label control from scratch?
-- Thanks!
|
|
|
|
|
Override the OnPaint event, like so:
using System;
using System.Drawing;
using System.Windows.Forms;
namespace WindowsApplication1
{
public partial class MyLabel : Label
{
private Color borderColor;
public MyLabel()
{
InitializeComponent();
borderColor = Color.Black;
}
public Color BorderColor
{
get { return borderColor; }
set { borderColor = value; }
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
e.Graphics.DrawRectangle(new Pen(borderColor),
new Rectangle(0, 0, Width - 1, Height - 1));
}
}
}
|
|
|
|
|
Thank you very much for getting back to me on this so quickly.
|
|
|
|
|
I tried this out and it works great. Thanks again.
|
|
|
|
|
hi everybody,
I don't really use treeviews at all, but I need to for my current prototype. ...What I really need is a nested treeview (treeview as a treenode) and I can't find any usage guidelines for adding a treeview to the treeview.Nodes collection....is it as simple as filling out an 'inner' treeview and adding it to 'outer' treeview's Nodes collection?
...or am I going to have to extend the TreeView?
btw...VS 2003, not 2005
(Nyquist_Rate || ! Nyquist_Rate)
{
Console.WriteLine("That is the question");
}//Go Colts
|
|
|
|
|
You can't directly add a treeview to another one. If you knew your 2nd treeview had only 1 root node then do something like:
treeView1.SelectedNode.Nodes.Add(treeView2.Nodes[0]);
If there are multiple top level nodes then do:
foreach (TreeNode node in treeView2.Nodes)
{
treeView1.SelectedNode.Nodes.Add(node);
}
|
|
|
|
|
ok..here's my problem. I'll provide code:
The indexer for which dataset to display in the treeview is controlled by the selected Index of a listview
if(lvwDisplay.SelectedIndices.Count > 0)
{
index = lvwDisplay.SelectedIndices[0];
UIAddress location = (UIAddress)myAddressList[index];
Now I create the structure in the treeview to allow the PointsOfInterest to be
deserialized from my collection
for(int asdf = 0; asdf < location.PointsOfInterest.Length; asdf++)
{
TreeView inner = new TreeView();
inner.Name = location.PointsOfInterest[asdf].Name;
inner.Nodes.Add(location.PointsOfInterest[asdf].Fee.ToString());
TreeView gps= new TreeView();
gps.Name="Geocode";
gps.Nodes.Add(location.PointsOfInterest[asdf].Center.X.ToString());
gps.Nodes.Add(location.PointsOfInterest[asdf].Center.Y.ToString());
.
.
.
PROBLEM: ...you'll see it
tvPOI.Nodes = new TreeNodeCollection[location.PointsOfInterest.Length];
tvPOI.SelectedNode = tvPOI.Nodes[asdf];
for(int i = 0; i<geocode.Nodes.Count;i++)
{
tvPOI.SelectedNode.Nodes.Add(geocode.Nodes[i]);
}
...tvPOI.SelectedNode is readonly. Anybody know how to implement the functionality I'm trying to add?
(Nyquist Rate || ! Nyquist Rate)
{
Console.WriteLine("That is the question");
}
|
|
|
|
|
SelectedNode has a get and a set so you can set it, but I think you're trying to select a node that hasn't been added to the Collection yet.
tvPOI.Nodes.Clear();
for (
{
tvPOI.Nodes.Add(
}
tvPOI.SelectedNode =
|
|
|
|
|
My error in my last post:
tvPOI.Nodes = new TreeNodeCollection[location.PointsOfInterest.Length];
tvPOI.SelectedNode = tvPOI.Nodes[asdf];
for(int i = 0; i
{
tvPOI.SelectedNode.Nodes.Add(geocode.Nodes[i]);
}
I shoulda said that tvPOI.Nodes is read only...not tvPOI.SelectedNodes
(Nyquist Rate || ! Nyquist Rate)
{
Console.WriteLine("That is the question");
}
|
|
|
|