|
How many forums have you wasted your time on!
And as has been mentioned, there are good reasons for hidden bidders on EBay. It is so that idiots like you don't go nicking their email addresses and selling them to spammer lists!
|
|
|
|
|
Bidders are hidden for a reason and there is no way to find out who they are, let alone their email addresses. Learn how ebay works before you start making ridiculous requirements for an app.
|
|
|
|
|
totolcm wrote: extract the hidden biders
That is why they are hidden so people like you don't see them
|
|
|
|
|
Hi,
I wonder if anyone can help me with the error I am getting when I try and run my application in VB 2008.
"Form1.vb cannot be modified at this time"
I have tried Tools/Option/Build and Run/ Don't save any changes. I have re-installed etc but with no success.
When I put say a button on the form the first time, it works. If I add another say button then that is when I get the problem. Basically adding anything to a form gets the error.
When I save my app then run, it works but I do not want to save before I run.
Thanks in advance
|
|
|
|
|
Isn't this the same question that you've already asked on the Visual Basic forum?
|
|
|
|
|
Yes.
I thought maybe someone who does not use VB would not look at VB message board.
|
|
|
|
|
And since your question pertains to VB, how is posting the question in a non-VB forum for people who don't use VB going to help find an answer?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
He got the wrong question as well as the wrong forum.
This question is about the Visual Studio IDE and not specific to any language, although it says VB 2008 in the subject. It is a typo, or a mis-comprehension.
So, I think this is the correct forum. It should not be in the VB forum.
|
|
|
|
|
You cannot add buttons or make any edits in the designer while the application is running.
You can however make changes in code.
Add your buttons, then run it is the only way.
PS. This is a limitation of the IDE, not language specific.
Or, as I should say, being able to edit-and-continue in the code at all is a feature not a limitation.
|
|
|
|
|
Hi,
The application was not running or looked as it had stopped. Is there anything that indicates that the app is still running? I did press the stop button. I can make a change to the form designer then go into the code and run no problem from there. It is a strange one that was driving me nuts but properly I am doing something wrong.
|
|
|
|
|
I have made a registration form after filling the form and submitting sometimes it inserts record in data base and sometimes it says file not found (error 404).why is this happening.... Plz help?
site url http://www.enefinder.com/registration.aspx
My code
try
{
int flg = 0;
SqlConnection cn = new SqlConnection("Data Source=server name;Initial Catalog=enefinde_memb;Persist Security Info=True;User ID=user name;Password=password");
String sql = "select * from regmember where email='" + txtEmail.Text + "'";
cn.Open();
SqlCommand cmd = new SqlCommand(sql, cn);
SqlDataReader dr = cmd.ExecuteReader();
if (dr.Read())
{
Response.Write("User name already exist Please Try Another One");
flg = 0;
}
else
{
flg = 1;
}
dr.Close();
if (flg == 1)
{
sql = "insert into regmember(enename,email,password,keyquestion,answer,address,city,state,country,perphone,mobile,cname,activity,yearofstarting,noofemp,location,website,phone)values('" + txtFname.Text + " " + txtMname.Text + " " + txtLname.Text + "','" + txtEmail.Text + "','" + txtPass.Text + "','" + ddlQuestion.Text + "','" + txtAns.Text + "','" + txtAdd.Text + "','" + txtCity.Text + "','" + txtState.Text + "','" + ddlCountry.Text + "','" + txtPerphone.Text + "','" + txtMob.Text + "','" + txtCname.Text + "','" + ddlAct.Text + "','" + txtStart.Text + "','" + ddlNoemp.Text + "','" + ddlCcountry.Text + " " + txtCstate.Text + " " + txtCcity.Text + "','" + txtWebsite.Text + "','" + txtPhone.Text + "' )";
cmd.CommandText = sql;
cmd.Connection = cn;
int i = cmd.ExecuteNonQuery();
if (i > 0)
Response.Write("Record Inserted");
//Response.Redirect("registration.aspx");
else
Response.Write("Not Inserted");
}
cn.Close();
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
}
}
|
|
|
|
|
guess0985 wrote: sometimes it inserts record in data base and sometimes it says file not found (error 404).why is this happening.... Plz help?
The 404 indicates that the webserver is the origin, not the database-server. Can you copy the exception and post it here?
You might also want to consider replacing the concatenated SQL-string with a parameterized version to prevent abuse via SQL injection[^].
I are Troll
|
|
|
|
|
Hi,
I am wondering if anyone coul help. I need use the paint event of a control to retun an image of that control.
I dont even know where to start.
Regards,
Martin
|
|
|
|
|
Martin Beukes wrote: I need use the paint event of a control to retun an image of that control.
I don't think so.
Either you want some special painting to occur in a Control, then you have to implement a Paint handler (this[^] would show the essentials), or you want a bitmap from an existing Control, then you would use Control.DrawToBitmap() which works fine for simple Controls, and needs quite some help for some Controls, such as RichTextBox (DrawToBitmap probably does call Paint itself, but that is not really relevant).
|
|
|
|
|
Hi Luc,
It is almost af if you can read minds. It is a richtextbox that i need an image of. There is no Control.DrawToBitmap() on the control and i have looked pretty much everywhere. I came accross this article [Here] which gave me the idea but none of the execution.
If you know of any way to get an image of a RichTextBox without using a screen capture, it would be much appreciated.
|
|
|
|
|
Just to make sure, here are my assumptions:
you have a RichTextBox, you did not add any explicit Paint or OnPaint method, it shows OK on the screen, but now you want to capture it to a bitmap without scraping the screen? if so I have that covered in C#. Is that OK?
BTW: why do you want a bitmap? and do you need printing?
modified on Monday, January 11, 2010 6:09 PM
|
|
|
|
|
Ok,
I have 2 RTB with diffent contents
I need to print these two RTBs contents on a single page
My plan is to use the GDI to an image of each RTB and then cmbine and print them.
Now the problem. more tha half my users will be on those godaweful netbooks with a screen resolution of 1024x6 <lol> and an A4 page and the my two RTBs is 1045x718 plus margins. So the problem is that i need to capture the whole control and not just what is onscreen.
|
|
|
|
|
I see. That is typical for the more complex controls: they hold a lot of data, not all of it visible at once, and you want to print more or all of it. You can try and solve that through DrawToBitmap (when available and functional), however that isn't very easy to do it right; it might be easier to skip the image and print directly.
I have an RTB derivative that offers both: Print (not tested) and DrawToBitmap (tested and OK). It is C# code. Is that OK?
|
|
|
|
|
awesome. thanks. would help a ton
|
|
|
|
|
Here you go:
using System;
using System.Windows.Forms;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Drawing.Printing;
namespace LP_Core {
[System.ComponentModel.DesignerCategory("Code")]
class LP_RichTextBox : RichTextBox {
private const double anInch = 14.4;
[StructLayout(LayoutKind.Sequential)]
private struct RECT {
public int Left;
public int Top;
public int Right;
public int Bottom;
}
[StructLayout(LayoutKind.Sequential)]
private struct CHARRANGE {
public int cpMin;
public int cpMax;
}
[StructLayout(LayoutKind.Sequential)]
private struct FORMATRANGE {
public IntPtr hdc;
public IntPtr hdcTarget;
public RECT rc;
public RECT rcPage;
public CHARRANGE chrg;
}
private const int WM_USER = 0x0400;
private const int EM_FORMATRANGE = WM_USER + 57;
[DllImport("USER32.dll")]
private static extern IntPtr SendMessage(IntPtr hWnd, int msg, IntPtr wp, IntPtr lp);
public int Print(int charFrom, int charTo, PrintPageEventArgs e) {
RECT rectToPrint;
rectToPrint.Top = (int)(e.MarginBounds.Top * anInch);
rectToPrint.Bottom = (int)(e.MarginBounds.Bottom * anInch);
rectToPrint.Left = (int)(e.MarginBounds.Left * anInch);
rectToPrint.Right = (int)(e.MarginBounds.Right * anInch);
RECT rectPage;
rectPage.Top = (int)(e.PageBounds.Top * anInch);
rectPage.Bottom = (int)(e.PageBounds.Bottom * anInch);
rectPage.Left = (int)(e.PageBounds.Left * anInch);
rectPage.Right = (int)(e.PageBounds.Right * anInch);
IntPtr hdc = e.Graphics.GetHdc();
FORMATRANGE fmtRange;
fmtRange.chrg.cpMax = charTo;
fmtRange.chrg.cpMin = charFrom;
fmtRange.hdc = hdc;
fmtRange.hdcTarget = hdc;
fmtRange.rc = rectToPrint;
fmtRange.rcPage = rectPage;
IntPtr res = IntPtr.Zero;
IntPtr wparam = IntPtr.Zero;
wparam = new IntPtr(1);
IntPtr lparam= IntPtr.Zero;
lparam = Marshal.AllocCoTaskMem(Marshal.SizeOf(fmtRange));
Marshal.StructureToPtr(fmtRange, lparam, false);
res = SendMessage(Handle, EM_FORMATRANGE, wparam, lparam);
Marshal.FreeCoTaskMem(lparam);
e.Graphics.ReleaseHdc(hdc);
return res.ToInt32();
}
public void DrawToBitmap(Bitmap bitmap) {
RECT rectToPrint;
rectToPrint.Top = 0;
rectToPrint.Bottom = (int)(bitmap.Height*anInch);
rectToPrint.Left = 0;
rectToPrint.Right = (int)(bitmap.Width*anInch);
RECT rectPage;
rectPage.Top = 0;
rectPage.Bottom = (int)(bitmap.Height*anInch);
rectPage.Left = 0;
rectPage.Right = (int)(bitmap.Width*anInch);
Graphics g=Graphics.FromImage(bitmap);
IntPtr hdc = g.GetHdc();
FORMATRANGE fmtRange;
fmtRange.chrg.cpMax = -1;
fmtRange.chrg.cpMin = 0;
fmtRange.hdc = hdc;
fmtRange.hdcTarget = hdc;
fmtRange.rc = rectToPrint;
fmtRange.rcPage = rectPage;
IntPtr res = IntPtr.Zero;
IntPtr wparam = IntPtr.Zero;
wparam = new IntPtr(1);
IntPtr lparam= IntPtr.Zero;
lparam = Marshal.AllocCoTaskMem(Marshal.SizeOf(fmtRange));
Marshal.StructureToPtr(fmtRange, lparam, false);
res = SendMessage(Handle, EM_FORMATRANGE, wparam, lparam);
Marshal.FreeCoTaskMem(lparam);
g.ReleaseHdc(hdc);
}
}
}
Please let me know the results when they become available, and/or any changes you consider necessary.
|
|
|
|
|
The PaintEventArgs are of no use, but you can call DrawToBitmap on the Control as Luc suggested in your Paint handler... something like this (untested):
private void Control_Paint(object sender, PaintEventArgs e)
{
Control control = sender as Control;
if (control != null)
{
using(MemoryStream memoryStream = new MemoryStream())
using (Bitmap bitmap = new Bitmap(memoryStream))
{
control.DrawToBitmap(bitmap, control.Bounds);
}
}
}
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
My company wants to allow users to scan test answer sheets from our web site and use OMR to score these tests. I have created a control that provides this functionality using VS 2008 (in VB.) I am able to embed the control using the object tag and classid attribute. To be able to do use this from a remote computer I have to use the .net 2.0 configuration app and add a codegroup for our website allowing full trust for code coming from our sitename and install an Access database on the machine. Using the 'Create Deployment Package Wizard' I was able to create a .msi file that (i think) replicates my settings/codegroup.
I have been able to get this to work on 5/6 machines I have tried but only a couple of them were simple (run the msi, add website as a trusted site, restart IE.) The other 2-3 I had to fool around with and do things like add the control to the GAC or manually add the code group and one of the machines is still unable to use the control.
I am hoping someone has an idea for a better deployment solution. I assume there is a way to incorporate the permissions setup, the database installation, and even framework installation into a single setup file/setup wizard but my biggest concern is reliability. Relying on the msi doesn't seem effective enough for release, especially since some clients will not have the .net 2.0 config as a backup.
I know a lot of my troubles are coming from the fact that I am trying to do something I shouldn't be doing. I read this similar post suggesting that the object be redone as an activex control so that IE will automatically ask the user:
http://social.msdn.microsoft.com/Forums...
Is activex the only viable solution here or is there something else that can be done? Our users will be willing to install whatever it takes on their machine so it doesn't need to be a 'click once' type of deployment at all. I have never worked with activex (or WCF for that matter.) If that is our only option is there a way to build the vb.net control i have as an activex control? From my early research i thought i found that .net doesn't support active x as it is being phased out by wcf so would i need to convert everything to VB6?
Sorry for such a long question filled post. I do appreciate any input or answers you have and I am willing to read articles or do research if you have links, i just seem to be hitting dead ends with my own searches.
|
|
|
|
|
sitruc7 wrote: Is activex the only viable solution here or is there something else that can be done?
I'd recommend to sign the code with a certificate that's trusted by the browsers that your clients have. There's also a post on 15 seconds[^] with more information on the Code Access Permissions that could help.
Alternatively, you could try embedding it using WPF[^].
I are Troll
|
|
|
|
|
Hello.
I'm using ADO.Net data services and i'm trying to do some kind of API to access to a data base in a remote server, execute a querie there and bring the data to me.
What i have to use, and how?
If you know some place with examples(code) send me the links.
Thank´s. When i finish i will share the code with everyone.
Wonderfull 2010 for everyone.
|
|
|
|
|
You don't need to do anything in your code. Set up your database to allow remote connections. You can do this using Surface Area Configuration in your server.
Then, look for connection string for a remote database in ConnectionStrings.com and you are done.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|