|
there are another problem !!!
in this method , how can i show images that there were in html source ??
i see : about blank ../../images/sx.jpeg with right click on picture in web browser .so what can i do??
|
|
|
|
|
I finally find out!!
object empty = System.Reflection.Missing.Value;
axWebBrowser1.Navigate("about:blank", ref empty, ref empty, ref empty, ref empty);
mshtml.IHTMLDocument2 doc = axWebBrowser1.Document as mshtml.IHTMLDocument2;
doc.clear();
doc.writeln("This is my text...");
doc.close();
doc = axWebBrowser1.Document as mshtml.IHTMLDocument2;
doc.execCommand("Print", true, 0);
|
|
|
|
|
there are another problem !!!
in this method , how can i show images that there were in html source ??
i see : about blank ../../images/sx.jpeg with right click on picture in web browser .so what can i do??
|
|
|
|
|
I am creating a new window app and am having difficulty with resetting focus to a form instead of opening multiple instances of the form. I have a menu to open formA for example from the MainForm menu. I want to have the logic be something like (from click of menu from MainForm)
If formA visiblity == true then
{ set focus to formA}
else
{ formA.show}
I can't seem to get the syntax for the if condition and the set focus command back to formA if it is already open.
Any help would be appreciated, thanks!
-- modified at 1:07 Saturday 27th May, 2006
|
|
|
|
|
if (formA.Visible == true)
{
formA.Select();
}
else
{
formA.Show();
}
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
www.troschuetz.de
|
|
|
|
|
I tried this but still it does not function correctly. If formA is not visible then it open a new instance no problem. the problem is if I go back and try and open it again, instead of selecting the previously opened form, it opens a new instance via formA.Show() even though copy of formA is open.
If I change visible == true, then it believes an instance is already opened even though one is not opened.
if (formA.Visible == false)
{
// shows new formA form
formA.Show();
MessageBox.Show("New Form");
}
else
{
// Reset focus to currently opened form
formA.Select();
MessageBox.Show("Reset Focus to form");
}
|
|
|
|
|
IMC2006 wrote: I can't seem to get the syntax for the if condition
It looks like you partially wrote it in VB
The syntax for the if statement is:
if ()
{
}
else
{
}
"On two occasions, I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question."
--Charles Babbage (1791-1871)
My: Website | Blog
|
|
|
|
|
if(formA == null)
{
formA = new FormA();
}
if(!formA.Visible)
{
formA.Show();
}
formA.Focus();
|
|
|
|
|
Hi,
In my form one datagridview control is there,insert button When we click on insert a new row is added to the datagidview.If we enter values in that new row and click on save button ,the newly inserted row is updated to database.To get this what code i have to write in save button click.
Please help me.
Thanks in advance
|
|
|
|
|
first you must set the gridview DataSource:
dataGridView1.DataSource =DS.tables["x"];
then u must add row to the DataTable for exmaple :
a = a+1;
b = textBox1.Text;
dt.Rows.Add(new object[] { a, b});
after click the button to update data in database:
scb = new SqlCommandBuilder(DA);
DA.Update(DS, "tbhazine");
|
|
|
|
|
Hi,
Thank you very much for your response.
|
|
|
|
|
Hi all,
I'm looking for some information about how to transform bmp images in GDI+. The operations I need to perform are: contrast, brightness, gamma correction etc...
Could anyone direct me at some sources concerning that matter? I understand I need to have some kind of transformation matrices to apply on the original image, but I'm not familiar with the mathematics behind such transformations.
Thanks,
Talal
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
YOu need to do a search on my surname in this site, and you'll find a whole series of articles on the subject.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Many thanks, found some articles (in VB.NET mainly) that I need to read thoroughly.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
I have image from file.
Icon icon = new Icon(ms, 16, 16);
Bitmap bm = icon.ToBitmap();
I need to resize my image, but i don't know how to do this.
For example 32x32 -> 16x16.
Please help me.
-- modified at 18:17 Friday 26th May, 2006
|
|
|
|
|
|
Take this approach, used in string search.
pixels are just bytes , and so is a string, go look how Boyer-Moore works for an efficient algorhitm.
|
|
|
|
|
Would I be able to use the algorithm on the byte pointer that is created? Or would I have to convert those bytes into a string? Would the following be a way to implement the algorithm?
Use the first "row" of bytes of the smaller image as the search pattern. Then search the whole byte array of the larger image for the first occurance(if any at all) of the search pattern. If there's a match, check the next "row" of bytes of the larger image to see if it matches the second "row" of bytes for the smaller image, and so on.
Thanks for the reply!
Jon
|
|
|
|
|
Yes you can just use the bytes (in pointer form).
Sorry I was a bit optimistic, but like you describe is correct. Basically search for 1st scanline of smaller image on a scanline basis using a string search approach. You can then be very liberal and move directly to the last scanline of the smaller image and use byte compare.
|
|
|
|
|
How can I catch the event of Minimize button click?
I can't find the event in VS2005, is there an option to get it or do I have to get something else?
|
|
|
|
|
handle the resize event, and if this.WindowState == FormWindowState.Minimized
|
|
|
|
|
Thanks
|
|
|
|
|
hi
you can use this code
private void btnmin_Click(object sender, EventArgs e)
{
this.WindowState = FormWindowState.Minimized;
}
|
|
|
|
|
Ok, here is the situation, I have a form named Worksheet with 2 typed datasets, RevenueDS and CostDS. The form shows all Revenue and Cost entries (in seperate panes) for the current contract. Also the net profit is calculated and printed at the bottom.
It serves it purpose, but people are complaining they cant print.
I need to make a single crystal report that shows all the above information on a single page. From what I gather, I need 2 subreports to accomplish this goal, one for Revenue and one for Costs and then the Net profit somehow will be computed on the main report(havent got that far yet).
The only problem is, I need to use the datasets in the program rather then have crystal reports get the data from the server. This has been no problem for a report with no subreports since I can just use something like:
<br />
WorksheetReport Report = new WorksheetReport();<br />
PrintingForm pf = new PrintingForm();<br />
Report.Database.Tables["Revenue"].SetDataSource(RevenueDS);<br />
Report.Database.Tables["Cost"].SetDataSource(CostDS);<br />
pf.CRViewer.ReportSource = Report;<br />
pf.Show();<br />
However, I can't find a reasonable way to get to the database of the Subreports, as there is no Subreports data member for Report such as:
<br />
Report.Subreports[0].Database.Table["Revenue"].SetDataSource(RevenueDS);
So, what can I do?
Thanks in advance.
Rob
|
|
|
|
|
Hi,
My code like this
public string str = "Provider=MSDAORA.1;user id=scott;password=tiger";
OleDbDataAdapter da ;
DataSet ds = new DataSet();
OleDbConnection con = new OleDbConnection(str);
da= new OleDbDataAdapter("select * from dept", con);
da.Fill(ds, "dept");
dataGridView1.DataSource = ds.Tables["dept"];
I want data entered in the datagridview is updated when i click update button.
In the button click event i write da.update(ds,"dept"),but it is giving the following exception: "Update requires a valid UpdateCommand when passed DataRow collection with modified rows."
In INSERT button click i write like this:
DataTable dt=new DataTable();
dt = (DataTable)dataGridView1.DataSource;
DataRow dr = dt.NewRow();
dt.Rows.Add();
dataGridView1.DataSource = dt;
Please help me.
Thanks in advance
|
|
|
|