|
I suggest you read up on Graphics.DrawImage() , it is all there.
|
|
|
|
|
Thanks, it's a good start ...
|
|
|
|
|
Hi,
On 1 (office) computer I get the error
Errormessage:Invoke of BeginInvoke kan niet op een besturingselement worden aangeroepen tot de vensterkoppeling is gemaakt. bij System.Windows.Forms.Control.WaitForWaitHandle(WaitHandle waitHandle) bij System.Windows.Forms.Control.MarshaledInvoke(Control caller, Delegate method, Object[] args, Boolean synchronous) bij System.Windows.Forms.Control.Invoke(Delegate method, Object[] args) bij System.Windows.Forms.Control.Invoke(Delegate method) bij Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.HideSplashScreen() bij Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.MainFormLoadingDone(Object sender, EventArgs e) bij System.EventHandler.Invoke(Object sender, EventArgs e) bij System.Windows.Forms.Form.OnLoad(EventArgs e) bij System.Windows.Forms.Form.OnCreateControl() bij System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible) bij System.Windows.Forms.Control.CreateControl() bij System.Windows.Forms.Control.WmShowWindow(Message m) bij System.Windows.Forms.Control.WndProc(Message m) bij System.Windows.Forms.ScrollableControl.WndProc(Message m) bij System.Windows.Forms.ContainerControl.WndProc(Message m) bij System.Windows.Forms.Form.WmShowWindow(Message m) bij System.Windows.Forms.Form.WndProc(Message m) bij System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message m) bij System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message m) bij System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
on starting the program. The second time I start the program it works fine.
Has someone an idee what this all means? and how to solve it
On my own pcs it works fine
Jan
|
|
|
|
|
Every WinForms Control (inluding a Form) has a Handle property which is used internally (it is to hold the HWND handle); when the control hasn't been sufficiently initialized, the Handle value is still undefined and some operations can't be performed yet. I don't remember having ever had the problem, however the solution should be:
- postpone special operations, maybe move some first-use code from the Form's constructor to its Load or Shown event;
- or: inside the Form constructor, force the handle to be generated, by executing something like IntPtr dummyHandle=myControl.Handle .
From the stack traceback, it seems like you may have a problem with a splash screen. I don' know for sure, and you might be using either a special VB one or one of your own, I do know I have seen lots of bad splash implementations: all control operations should run on the main thread, and that holds true for the splash screen as well.
BTW: if you do something like (this is C$, don't know how it gets packaged in VB):
Splash splash=new Splash();
splash.Show();
MainForm form=new MainForm();
form.Splash=spash;
Application.Run(form);
then:
1) everything runs on the main thread;
2) the splash is visible as soon as possible;
3) the splash is fully initialized before the MainForm constructor might access it.
VB may offer its own implementation of a splash, and if so I don't know whether it is any good.
|
|
|
|
|
On the mainform and on the splashscreen are no controls that I have made. all basic stuff
The spash is handled by vb itself.
It still confuses me tha this only happend by my office computer, but not always, and not on other computers.
Jan
|
|
|
|
|
I am in the process of converting a project from vb6 to vb.net. Code is now re-written and I can run it.
The first thing I see is that when I select and option to load a form from my main screen, I see lots of animation which I assume to be me moving my controls around, before the form clears itself up and looks like I wanted it to.
I have anywhere from 100 to 300 text boxes, labels buttons and so-on that I arrange based on the system configuration. This is all done dynamically in code as the form loads because they can be vertical, horizontal, different quantities and so-on based on what type of hardware it is connected to.
I tried making the form not visible in the load event but no luck, any other suggestions?
It was very clean in VB6
No-e
|
|
|
|
|
Frankly, I wouldn't be doing what you described. 300 controls on a form is excessive and takes forever to render. Rearranging them from their initial layout just makes things worse.
I'd probably be skipping the textboxes all together unless these values can be updated.
In either case, I'd look at compartmentalizing these in logical groups and creating controls or usercontrols that handle/rearrange/draw themselves depending on the data that's passed to them. You could then create instances of only those controls you need at runtime.
Form.Load only happens the first time a form is displayed and happens just before it's shown. You'll get another event, VisibleChanged, when that happens.
The earliest event you get from a form is HandleCreated.
|
|
|
|
|
InterOp to LockWindowUpdate API could be used to disable drawing for a sec.
Bastard Programmer from Hell
|
|
|
|
|
I have the following line of code but it says that String input is not in proper format. What is wrong in following piece of code
Dim addCount As String
addCount = Me.txtItemNumber.Text + "." + (count + 1)
|
|
|
|
|
Nothing. The code you posted cannot possible throw that exception.
Your probably talking about a line of code that mentions "Parse" somewhere in it.
|
|
|
|
|
|
Yeah, there is that, but nothing in the code snippet posted would generate the error.
|
|
|
|
|
compiler errors (as well as run-time exceptions) provide accurate information about class names, file names, and line numbers for all the problems they want to refer to. And any decent IDE can show source code including line numbers; it is unfortunate Visual Studio has that feature off by default.
Hence: turn on the "show line numbers" option, and then look at the exact line where the problem occurs.
BTW: always log exceptions in their full length, i.e. use their multi-line ToString() result, not their Message property.
|
|
|
|
|
1
modified 28-Nov-12 4:06am.
|
|
|
|
|
how is each sub level defined in the file?
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
|
Make a list where you add a text when you enter a new sublevel. Then iterate until you reach a new level, removing everything in the list.
Where are you stuck?
Bastard Programmer from Hell
|
|
|
|
|
I tried this code to open Google site from Vb.net and display the data in Textbox on the form to textBox on the Google, but didn't success with, by displya the data only the code open the Google.
By the way I using the dll file "SHDocVw"
notice:"description" is the name of TeXtBox in google
Imports SHDocVw
<pre lang="vb"> Dim objIE As SHDocVw.InternetExplorer
objIE = CreateObject("InternetExplorer.Application")
objIE.Navigate("http://Google.com")
objIE.Visible = True
objIE.Document("description").ToString = TextBox1.Text
|
|
|
|
|
Example:
1 st combo box item
2 nd combo box item
3 code no is text box
4 th in combo box item
then above 4 field to generate the auto sr.no. what can code in vb6..
plz help me...
|
|
|
|
|
anghan22 wrote: then above 4 field to generate the auto sr.no.
I have no idea what this is supposed to mean, but you may like to look here[^] for some help.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Example:
1 st combo box is select= LSO then
2 nd combo box is select=Ls1
what are the code...?
plz help me
|
|
|
|
|
sometimes people don't know hoq to ask for what they want.
Encourage them by asking specific questions.
|
|
|
|
|
I don't think this is the forum for your comment; you probably meant to post it here[^], where it would make sense.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
That sadly is what has been tried and tried again. People here will try to get the information out of person asking the question. BUT not everybody has the time to do this on a daily basis
Lobster Thermidor aux crevettes with a Mornay sauce, served in a Provençale manner with shallots and aubergines, garnished with truffle pate, brandy and a fried egg on top and Spam - Monty Python Spam Sketch
|
|
|
|
|
Cameron Atkinson wrote: Encourage them by asking specific questions
I'll stick to answering questions that I think are worth answering. We're volunteers.
Bastard Programmer from Hell
|
|
|
|