|
What have you done so far? What have you used to render the PDF to an image? Where, exactly, are you stuck?
It's important to remember that we can't see your code so we don't know what you've done or where you are having problems.
|
|
|
|
|
hi all,
i saw in this link:
https://msdn.microsoft.com/en-us/library/system.windows.forms.splitcontainer.orientation(v=vs.110).aspx
how to vertical container
my question is: how i do when i click iin button opened duplicate form but vertical???
thanks for all the helpers
|
|
|
|
|
Your question is not clear.
Creating a new Form is one task.
Creating a new Form and inserting a SplitContainer Control in it with 'Vertical orientation is another task.
Duplicating a Form ... creating a new version of a design-time specified Form ... is another possible Task.
Please describe exactly what you want to achieve.
«To kill an error's as good a service, sometimes better than, establishing new truth or fact.» Charles Darwin in "Prospero's Precepts"
|
|
|
|
|
i have a mdi form name "Main".
the mdi form include 1 form with container horenzial name "Sub"
i want to do a button on the Main form that open the "Sub" form as a new winform (not in mdi) and the container be a vertical
sorry on my bad English.
thank you
|
|
|
|
|
First, I'd define a public Property on your 'sub Form that allowed me to set and get the SplitContainer's 'Orientation property:
public Orientation CurrentSplitterOrientation
{
set { splitContainer1.Orientation = value; }
get { return splitContainer1.Orientation; }
} I'd use a public Property because I'd assume that I would want access the current value of 'Orientation, as well as set it.
In the Main MDI Form, you can "release" the MdiChildForm by setting its 'MdiParent property to 'null:
private SubForm1 subForm1 = new SubForm1();
private void Form1_Load(object sender, EventArgs e)
{
subForm1.MdiParent = this;
subForm1.Show();
}
private void button1_Click_1(object sender, EventArgs e)
{
subForm1.MdiParent = null;
subForm1.CurrentSplitterOrientation = Orientation.Vertical;
} I'd like to suggest you consider the following:
1. MDI architecture is now really out-dated, and if you have the choice, I suggest you don't use it.
2. Putting any Control on the MDI Parent Form itself, except maybe a ToolStripMenu, is generally a bad idea.
3. Changing a Form's status from being an 'MdiChildForm to being "just another" Form on the Desktop is ... well ... unusual. This may be confusing to your end-users. You might consider, instead of an MDI Parent to Child relationship, using the 'Owner property of the secondary Form ... set it to the Main Form, instead. A Form which has an 'Owner is guaranteed to remain in front of its'Owner Form.
«To kill an error's as good a service, sometimes better than, establishing new truth or fact.» Charles Darwin in "Prospero's Precepts"
|
|
|
|
|
thank you again..
its not working..
i just want to duplicate the MDI CHILD
on:
test frm = new test();
frm.show();
and do it verticl just on the "outside" form - not on the mdi child
|
|
|
|
|
i have a string like this 2+4 ,(s[0]=2,s[1]=+,s[2]=4).
how can i get 2, 4 from it ?
|
|
|
|
|
your question needs a bit more refinement before anyone can attempt to answer it
for example, I see 3 x '2's and 2 x '4's in your 'string' - which ones do you need?
if for example you want the '2' and '4' from this '2+4', is the '+' a constant/does it change & what are the values ?
knowing exactly which 2 & 4 and what may change in that string might help someone give you an answer
|
|
|
|
|
Please don't cross-post. You already got answers in the Q&A forum.
|
|
|
|
|
Hi,
I am using the following code to generate a bitmap:
System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(panelControl1.Width, panelControl1.Height);
panelControl1.DrawToBitmap(bmp, panelControl1.ClientRectangle);
I would like t ask how can I embed the bmp in my MailMessage's email body?
Thanks,
Jassim[^]
Technology News @ www.JassimRahma.com
|
|
|
|
|
It would need to be encoded and part of a MIME message[^]. Also part of .NET[^] and I'm sure CodeProject has some articles on the subject too.
Try this; send yourself an email and open in outlook. Now right-click and select "view source".
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
There's an example here[^].
There's also an example of creating attachments from a stream[^]. (The LinkedResource class works in a similar way.)
Combining the two would give you something like this:
using (MailMessage mail = new MailMessage())
{
mail.From = new MailAddress("me@mycompany.com");
mail.To.Add("you@yourcompany.com");
mail.Subject = "This is an email";
AlternateView plainView = AlternateView.CreateAlternateViewFromString("This is my plain text content, viewable by those clients that don't support html", null, "text/plain");
AlternateView htmlView = AlternateView.CreateAlternateViewFromString("<p>Here is an embedded image: <img src=\"cid:myimage\"></p>", null, "text/html");
MemoryStream stream = new MemoryStream();
theImage.Save(stream, ImageFormat.Jpeg);
stream.Seek(0L, SeekOrigin.Begin);
LinkedResource imageResource = new LinkedResource(stream, MediaTypeNames.Image.Jpeg);
imageResource.ContentId = "myimage";
htmlView.LinkedResources.Add(imageResource);
mail.AlternateViews.Add(plainView);
mail.AlternateViews.Add(htmlView);
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);
}
You just need to make sure that each embedded resource has a ContentId which is unique within the message, and refer to the resource within the view as cid:ContentId .
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
When a hidden form was shown again, after I clicked on the Cancel button in the form, the change in the TextBox of the form was kept.
I am new in C#. Any advise will be appreciated.
modified 10-Mar-15 11:52am.
|
|
|
|
|
Your program needs to respond to the Cancel button event and actually do something.
|
|
|
|
|
The application does not "remember" the previous value; you'd have to write that. Save the content of the textbox when you show it, and overwrite it with that value when the cancel-event fires.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Are you showing the "hidden" Form using 'ShowDialog ? ... or ? More details, please.
«To kill an error's as good a service, sometimes better than, establishing new truth or fact.» Charles Darwin in "Prospero's Precepts"
|
|
|
|
|
Hello ,
I want to display just a part of a JPEG image (from ofsset 1 to offset 2). I use a pictureBox to display the hole image.
Help please
|
|
|
|
|
|
Hello ,
I want to display just a part of a JPEG image (from ofsset 1 to offset 2). I use a pictureBox to display the hole image.
Help please
|
|
|
|
|
i am looking for the knowledge regarding pushing database change notification. i know that people will tell me to use sql dependency class but i used that it has some problem.
if sql dependency class is monitoring table for long time and if no data change occurred for that table then sql dependency class throw exception. we can create max 100 instance of sql dependency class.
i am looking for something which i can use in a situation where many user changing data in a table constantly and all change notification will send message to front end application. again i do not like to use polling technique rather i want to use push technique.
it will be very helpful if someone discuss how advance developed handle this situation where sql server and c# is used. please guide me in details. thanks
tbhattacharjee
|
|
|
|
|
A database is not "live" data; it should not report each and every change.
The best option would be polling. For a decent push, there's SqlDependency, but it is not meant to update each and every client of each and every notification in the model. If that is what you need, consider syncing with the client-database.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
what technology people use in share trading application because each share price frequently goes up and down. if the same trading win apps is using 1000 user and if we use polling technology then database will be hit again and again. so discuss if you were in that kind of situation.
tbhattacharjee
|
|
|
|
|
You can always cache the results on a fixed expiry. So for each stock quote cache on 3 mins (or whatever) so that subsequent apps all get their value from the cache and your database is only hit once every 3 mins. If you need the data to be more dynamic than that then you can use sqldependency etc to kick off a task that clears the quote from the cache so that your cache is always up-to-date.
|
|
|
|
|
thanks for your time. suppose if i cached data and web service will pull data from cache and push those data to all connected clients. if i design that way then after every certain interval my web service need to pull data and push data to all connected clients. i guess web service constantly do the polling to hit the cache.
i want a good mechanism like that i need to push only change data not all data from cache.
really looking for details information that how people manage to developed this kind of apps with good scaling.
tbhattacharjee
|
|
|
|
|
All in all, it seems you are looking for a solution with "good scaling" that only involves software.
You need to accept that software alone will only get you so far; and that at some point, you may need to throw more / better hardware at the problem; i.e. multiple application servers / server farms. One does not have to "host" either; one can buy as many "cloud cycles" as one needs without any long-term obligation.
A solution that includes additional hardware may be cheaper, easier and quicker to implement than agonizing over the "best" software solution for who knows how long (and then trying to "optimize" it).
I think you should start with a (small) prototype and go from there; simply because some of your assumptions are wrong or poorly defined:
- Is this a Windows client or browser-based client-server app?
- Do all the clients have to same bandwidth?
- What sort of client "devices" are we talking about?
- What is the client going to do with a given "notification"?
- Even if an SqlDependency instance "threw an exception", why do you think this is a problem? (Just create a mechanism to restart it)
- Why do you think that "100 SqlDependency instances" is a limitation? Or put another way, why do you think you need that many or even more?
- What kind of response times are you thinking you need? Can notifications be "interleaved" among clients? If not, why not?
- etc.
(Do the prototype).
|
|
|
|