 |
|
 |
When posting your question please:- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode HTML tags when pasting" checkbox before pasting anything inside the PRE block, and make sure "Ignore HTML tags in this message" check box is unchecked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers, Chris Maunder
The Code Project Co-founder Microsoft C++ MVP
|
| Sign In·View Thread·PermaLink | 5.00/5 (4 votes) |
|
|
|
 |
|
 |
I m trying to click mouse automatically using code in some specific location for this i m using following code but its not working
[System.Runtime.InteropServices.DllImport("user32.dll")] public static extern void mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraInfo);
public const int MOUSEEVENTF_LEFTDOWN = 0x02; public const int MOUSEEVENTF_LEFTUP = 0x04; public const int MOUSEEVENTF_RIGHTDOWN = 0x08; public const int MOUSEEVENTF_RIGHTUP = 0x10;
public void MouseClick() { int x = 100; int y = 100;
mouse_event(MOUSEEVENTF_LEFTDOWN, x, y, 0, 0); mouse_event(MOUSEEVENTF_LEFTUP, x, y, 0, 0); }
Plz Help me To move cursor i m using Cursor.Position = new Point((int)10, (int)10); thats working fine
Plz help
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Hi,
I'm using the following user32 functions: - SetCursorPos() to move the mouse - SendInput() to give a MOUSEEVENTF_LEFTDOWN and MOUSEEVENTF_LEFTUP
IIRC the x,y parameters of mouse_event describe a relative mouse movement, so I keep them at zero.
Here are my P/Invoke prototypes:
[DllImport("user32.dll", CallingConvention=CallingConvention.StdCall, SetLastError=true)] public static extern IntPtr SendInput(int count, ref INPUT2 input, int size);
[DllImport("user32.dll", CallingConvention = CallingConvention.StdCall, SetLastError = true)] public static extern IntPtr SetCursorPos(int x, int y);
public struct MOUSEINPUT { public int dx; public int dy; public int mouseData; public int dwFlags; public int time; public IntPtr dwExtraInfo; }
public struct INPUT2 { public uint type1; public MOUSEINPUT mi1; public uint type2; public MOUSEINPUT mi2; }
Luc Pattyn
I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi,
Kindly help me, i took textbox from one of my other project into my current project but whenevr i click on Form Design its showing me this errors:
The variable TextBox1 is either undeclared or was never assigned Plzzz help me...
Thank you
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
mirzamujib wrote: The variable TextBox1 is either undeclared or was never assigned
That's a fairly clear error message. Somewher in your copying you have omitted an allocation or reference so the main form does not have a variable called TextBox1. Take a look at the form and also the code behind to see which parts are missing. You would probably have found it simpler to add a new text box from scratch rather than doing it this way.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Delete the textbox and copy it again. Sometimes, Visual Studio suffers from selective amnesia in that it copies only a part of the code and leaves the rest.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi,
Kindly help me, i took textbox from one of my other project into my current project but whenevr i click on Form Design its showing me this errors:
The variable TextBox1 is either undeclared or was never assigned in vb.net Plzzz help me...
Thank you
|
| Sign In·View Thread·PermaLink | 1.00/5 (1 vote) |
|
|
|
 |
|
 |
Hi, What are the different ways to run a exe file auto in WindowsXP? or we have to just create a autorun.inf file.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
On my form I have 4 controls that span the width of a form. The controls each take up ~1/4 of the available vertical space and are stacked such that the vertical space is almost completely used.
I'm having trouble getting the controls to correctly resize vertically when I resize the form. I want to maintain the same layout as now, but if I anchor both the Top and Bottom then the upper-left corner of each control is fixed, so they overlap when I resize.
How can I allow the "anchor" point to slide proportionally to the resize and maintain the same aspect?
Thanks
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
|
 |
|
 |
Hi I am developing application where i want to use some APS fonts which r=are installed in machine. I am having error while i select one of APS font in font dialog box. The error says it is not a true type font . But when i check the font in font folder of control panel there it says its a true type font.
My application will not work with out this font selection . Please help me.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I can usually muddle my way through creating a regular expression but this one has me stumped (even with Expresso). I need to search through the contents of a text box and find each word in an HTML doc, but avoid the text within the tags. I have a Regex that works fine in a plain text file, but not in a doc with tags.
Example: <li>List Item</li> I'd want to find "List" and "Item" but not "li" or "/li"
If anyone has a Regex pattern that does this I'd love to see it, with thanks.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Alan, try this. The code originally came from the netSpell library, so i'm not 100% it works correctly...
Private _htmlRegex As Regex = New Regex("</[c-g\d]+>|</[i-o\d]+>|</[a\d]+>|</[q-z\d]+>|<[cg]+[^>]*>|<[i-o]+[^>]*>|<[q-z]+[^>]*>|<[a]+[^>]*>|<(\[^\]*\|'[^']*'|[^'\>])*>", RegexOptions.IgnoreCase Or RegexOptions.Compiled)
"An eye for an eye only ends up making the whole world blind"
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Just ran it thru Expresso. It actually finds the tags, not the text between them. I have a Regex for stripping html, but I think this one might work better. So I can still use it. Thanks!
Hadn't thought about it before but I've got a copy of NetSpell somewhere. I'll poke around inside and see what I can see.
AB
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Didn't find a Regex I could adapt in the NetSpell files. Will keep hammering on the thing. I keep thinking I'm missing something obvious but don't know yet what it is.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi All!
Please help, How to create DropDownButton in WindowsForms application?
I do not want to use ToolStripBar with ToolStripDropDownButton. I would inherit from class Button but what is the best way to implement drop down functional?
Thank you!
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Suggestion: Using most any paint program, create a very small arrow similar to the one in most drop down buttons. Create it pointing down and save it, then flip it vertically and save it again under a different name. Now you have your up and down arrows for the button.
Drag a regular button onto your form and set the text. Add the down arrow, aligned to the right of the text.
Create a ContextMenuStrip for the button and add the desired items.
Write code so that when the button is clicked once, the button's image changes to the up arrow, and the context menu appears below the button. Next time it's clicked, reset the button image back to the down arrow and close the context menu. You can monitor the button's "state" with a boolean variable and the menu's Visible property.
Also, add a line of code to each event handler in the context menu so that the button's image changes back to the down arrow when a menu item is clicked - since the menu will close.
Not a perfect solution, but I did something similar with ActionScript a few years ago and it worked quite well.
Best AB
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
I have a application that has 2 tabs, one tab is wired to show a web page whose .aspx file has auto refresh set. The other tab doesn't access the web page at all. When I access any of the tabs I see that the web page is refreshing(hear the clicking sound), instead I want to disable the web page refresh whenever I access the 2nd tab. I set the "AllowNavigation" property of the webbrowser control to false when tab is switched to the 2nd one and set this property to true when I switch the tab to the 1st one.
But what happens is when I switch back to the 1st tab the auto refresh doesn't work unless and until I click some web page controls. Is there a way to enable/disable auto refresh of a web browser control from Win forms?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Member 3365607 wrote: But what happens is when I switch back to the 1st tab the auto refresh doesn't work unless and until I click some web page controls.
And if you navigate to, say, Google when you hide the browser, and navigate back to the .aspx when you show it?
Another alternative would be to download the webpage and to save it directly to a string/a file. Then you could manipulate the webpage before displaying it in the browser. That way you can change any meta-refresh tags before feeding it to the browser
I are Troll 
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Thanks Eddy. I will try that. Looks like the web browser control cannot control the auto refresh of .aspx.
I couldn't get ur question : And if you navigate to, say, Google when you hide the browser, and navigate back to the .aspx when you show it?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Member 3365607 wrote: And if you navigate to, say, Google when you hide the browser, and navigate back to the .aspx when you show it?
You could let the WebBrowser navigate to another site (Google only as an example) when you switch to tab 2. When the user switches back to tab 1, navigate to the original .aspx page again. That at least prevents the clicking-sounds of the refresh
I are Troll 
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
Hi,
This is Siddhardh, beginner in using VC# and ADO.Net. Here i am creating a project for Medical Vaccines. I have created a form, which consists of out going products or Selling Goods to the customers. After Submitting the details, the data has been saved to the relevent Tables(SALESDATA and SALES), at the same time, i need to generate the bill for the current Invoice Number after submitting the data to the SQL Tables. So pls help me to code for this.
Thanks in advance.
Regards,
Siddhardh.
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |
|
 |
siddhardh wrote: i need to generate the bill for the current Invoice Number
Define what you mean, what is a bill?
|
| Sign In·View Thread·PermaLink | |
|
|
|
 |