|
Hi Guys,
Quick question.
How can i apply say Silver theme to my app while xp is using blue?
I've seen this done but don't remember where or how.
Plz help
The perfect code is always in your head...it just a matter of how hard you bang your head against the wall to get it out!
|
|
|
|
|
You'd have to owner draw stuff, I guess, then you can draw it any way you like.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Christian is right. You'd have to ownerdraw everything yourself. Applications cannot use one system theme and the system use another at the same time. You have to do all the drawing work yourself.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I was kinda hopping to avoid that...no time.
Thanks for your time guys
The perfect code is always in your head...it just a matter of how hard you bang your head against the wall to get it out!
|
|
|
|
|
Hi Guys,
I hope everyone is well and filled with caffeine...I know i'm
I've read in one of the posts here recently that it's not a good idea to keep the code that does not run the ui inside the form and usercontrol classes as it will run on the same thread as the ui and slow down the app. Which does make a lot of sence
Not that it makes much difference but I have all my code in dll's and for processing purposes the forms only call dll functions, anything ui related is kept inside the form modules and usercontrol classes.
So
What's the syntax to start a new thread and run specific code on it?
Also
Do I need to keep track of the threads, if so how?
Finally, as far as canceling of currently running code is concerned
How do I handle threads, and cancel code running on them?
The perfect code is always in your head...it just a matter of how hard you bang your head against the wall to get it out!
|
|
|
|
|
Alex Feature wrote: it's not a good idea to keep the code that does not run the ui inside the form and usercontrol classes
Correct, your business logic should be seperate from presentation logic.
Alex Feature wrote: as it will run on the same thread as the ui and slow down the app.
No, you can put code in the UI layer that runs in another thread, and moving code out to a middle tier won't change it being in the same thread.
Alex Feature wrote: What's the syntax to start a new thread and run specific code on it?
ThreadStart and Thread are the two classes you need.
Sounds to me like you need to google threading in VB.NET and read some articles.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Thanks Christian.
NOW! Where is that damn coffe pot...I got some catching up to do!
The perfect code is always in your head...it just a matter of how hard you bang your head against the wall to get it out!
|
|
|
|
|
hi,
how to check whether duplicate values are present in a dataset.i have to check whether the combination of 2 fields in the dataset does not repeat.for eg.name and rollno.
i have done it using For loop.if anyother way pls help me.
|
|
|
|
|
You'd do better to set constraints on your data source so this can't ever happen.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Hi guys
I want to set Internet Explorer Printer Page Setup options Paper Source, Size etc. programatically, kindly help me in this regard.
Thanx in advance.
|
|
|
|
|
I am still a little new to vb.net and I tried to print to the printer like I did in vb6 and it has changed I have done some research on this and found some tutorials but with no luck on what I am looking for. An ex. of the code would be like Printer.Print "Whatever" but when i go Printer.Print("Whatever") it gives me an error message. If someone could help me out with this I would really appreciate it. Thank You for you time.
B.
|
|
|
|
|
Bso_Cool wrote: I have done some research on this and found some tutorials but with no luck on what I am looking for.
Looks[^] to me like there are lots of tutorials.
Bso_Cool wrote: but when i go Printer.Print("Whatever") it gives me an error message.
I guess that's why no tutorials tell you to do this, it's changed from VB6.
I suggest following any of the tutorials I brought up with google, or asking a more specific question about the nature of what you want to print.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I want to drag Image and Image will follow cursor until we drop it.
Such as we drop it in Panel Area
(Like when you drag "Textbox" Control and Place to Designing Form in Visual Studio)
I do it and have problem with Mouse Position
I don't find Cursor Location when I over Panel Area
I use VB.NET 2005
|
|
|
|
|
The easiest way to do this is to draw the image yourself on the screen, no picture box. If you want to do drag and drop, impliment it as drag n drop ( that is, use the messages provided by the framework ), and set the cursor of the controls you can drag over, including the main window, to be one you create of the image in question.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
hi i placed 2 richtextboxes and one button on a form
1st richtextbox named "result"
2nd richtextbox named "text1"
i want when i click on button,then it search the word "abcd" in text1.text, if found then write result.text in text1.text in second line("abcd" may be in any line)
so i coded on button :
If InStr(Text1.Text, "abcd") Then
text1.Text = text1.Text + InStr(text1.Text, "abcd") & Microsoft.VisualBasic.ChrW(13) + result.Text
End If
but it gives error that
An unhandled exception of type 'System.InvalidCastException' occurred in microsoft.visualbasic.dll
Additional information: Cast from string "abcd" to type 'Double' is not valid.
|
|
|
|
|
Are you sure that the error message comes from the code that you have shown? The only thing that seems relevant in the error message is the string "abcd", unless of course if you created your own InStr function.
---
b { font-weight: normal; }
|
|
|
|
|
|
I see. Yes, perhaps your strange code might produce that error, but I am not really sure how. Perhaps the compiler got confused by all your implicit conversions, and tried to convert everything to the number with the largest capacity, which is a double.
If you use a bit less implicit conversions, I'm quite sure that it might work better. The InStr function returns an integer, not a boolean and not a string. If you want to concatenate strings, either stick to the & operator, or make sure that what you are concatenating is really strings.
---
b { font-weight: normal; }
|
|
|
|
|
ok so can you tell the codes which will work?
|
|
|
|
|
I just explained some problems with your code. Can't you at least make an attempt to fix them before asking me to do the work for you?
---
b { font-weight: normal; }
|
|
|
|
|
man i tried about 50 times and every angle but no benfite then i wrote my problem in this forum
|
|
|
|
|
The "+" signs cannot be used to concatenate strings together. You MUST use "&" signs. Also Instr is deprecated. I think it's replacement is String.IndexOf[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave Kreskowiak wrote: The "+" signs cannot be used to concatenate strings together. You MUST use "&" signs.
That is not true at all. The + operator can be used to concatenate strings just fine. The & operator is used when you concatenate values that doesn't need to be strings, but you want them to be converted to strings first.
Dave Kreskowiak wrote: Also Instr is deprecated. I think it's replacement is String.IndexOf[^].
Not really deprecated. It's one of the functions in the Microsoft.VisualBasic assembly for simplifying the transition from VB 6.
---
b { font-weight: normal; }
|
|
|
|
|
Guffa wrote: That is not true at all.
True, but that's what happening in this case. I'm telling him that to keep him locked into putting string together with one operator (&) and doing math with the other. What's happening in his code is that the cast is failing because the value of Text1 or Result, appearing to be "abcd", is failing a conversion to Double so it can be added to the result of InStr which returns a number.
Guffa wrote: Not really deprecated. It's one of the functions in the Microsoft.VisualBasic assembly for simplifying the transition from VB 6.
I hate that we even have to do this!!
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Dave Kreskowiak wrote: I'm telling him that to keep him locked into putting string together with one operator (&) and doing math with the other.
So you tell a lie to make him write code in a certain way? Don't you think that the truth might have the same effect?
Or do you think that you need to be an MVP to handle the truth? For beginners it's the blue pill?
---
b { font-weight: normal; }
|
|
|
|